Problem/Motivation

Currently, CRM Case does not support structured workflows. While Drupal provides the Content Moderation module, its revision-based model is unsuitable for CRM cases. Case status changes represent state transitions, not editorial revisions.
A proper workflow system is needed to track case status changes, enforce valid transitions, and trigger actions like notifications, without introducing unnecessary revision complexity.

Steps to reproduce

  1. Enable CRM Case.
  2. Attempt to configure case status workflows using Content Moderation.
  3. Observe that the concept of "latest revision" or "default revision" does not make sense for Cases.

Proposed resolution

Integrate CRM Case with the core Workflow module to manage case status transitions.

  • Each Case Type can reference a Workflow configuration entity.
  • Add a required workflow field to each Case entity that stores the current workflow state.
  • Provide APIs to perform transitions, validate allowed transitions, and trigger a crm_case.transition event.
  • Provide UI elements (dropdown or buttons) showing only transitions the current user is permitted to perform.
  • Log transitions as Case Activities for auditing purposes.
  • Optional integration with Drupal Actions or Rules to automate tasks such as notifications.

This approach avoids revision-based moderation, keeps workflow states simple and data-driven, and allows reporting and filtering on case status using Views or entity queries.

Remaining tasks

  • Add workflow field to CRM Case entities.
  • Create a service for performing and validating workflow transitions.
  • Add UI support for transitions per Case Type and user permissions.
  • Log transitions in Case Activity stream.
  • Create default workflow configuration for basic CRM usage.
  • Document setup and usage instructions for site builders.

User interface changes

  • Case edit and view forms display a dropdown or buttons for valid workflow transitions.
  • Activity log shows historical workflow state changes.
  • Views integration allows filtering and sorting by workflow.

API changes

  • New service for performing workflow transitions on Case entities.
  • Dispatch crm_case.transition events on state changes.
  • Expose workflow field for programmatic queries and Views.

Data model changes

  • Add workflow field to store the current workflow state.
  • Case Types reference a Workflow configuration entity.
  • No revisions are used; workflow state changes overwrite the current field value.

Issue fork crm_case-3554370

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bluegeek9 created an issue. See original summary.

bluegeek9’s picture

Issue summary: View changes

bluegeek9 changed the visibility of the branch 1.0.x to hidden.

bluegeek9’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

bluegeek9’s picture

//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM Case as a favorite on the project page to help others discover it and show your support.
  • Review the Developer Docs for accuracy and clarity.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.