Enhance your case management process by customizing state transitions with Torq workflows. This guide explains how to assign workflows that automatically verify and execute state transitions, ensuring all procedural requirements are met before the case state is updated. This feature is particularly useful for maintaining compliance with organizational protocols during case investigations.
Create and publish the following workflows:
In the example use case below, when an analyst attempts to close a case, they are prompted to provide information about the investigation. By setting up the two workflows mentioned above, you can present questions, evaluate the responses, and decide whether to update the case state to Closed, ensuring compliance with the organization’s requirements.
A template for this use case is available in our Templates library.
1. Define the Behavior Upon Manual State Changes
Implement any logic to check whether the state transition can be performed.
Set the Workflow Trigger:
Use the On-demand trigger, or
Use the Torq Interact trigger to collect user input or display messages.
Implement Logic: Determine the conditions under which the state transition can occur. Examples include:
Allow a state transition only if the case was in a specific state (e.g., allow closure only if the case was "In Progress").
Authorize the state transition exclusively for specific users.
Perform the State Transition: Once the requirements are met, use the Change case state step to execute the transition.
Notify Analysts: We recommend using Torq Interact to inform users of the outcome and provide reasons if the state change was unsuccessful.
Publish the Workflow: Finalize and publish the workflow before moving on to the next step.
Use Case Example: Collecting User Input for State Change Decisions
Use the Torq Interact trigger to initiate the workflow. Add interaction elements to collect user input and have it available in the context of the trigger event.
Based on the input collected, decide whether to proceed with the requested state change. Use the Change case state step to determine the state to which the case will transition. When changing the case state to Resolved or Closed, a resolution reason must be provided. The example below demonstrates utilizing the user input provided earlier as the reason for the resolution.
Use Torq Interact to notify the user about the state change outcome and provide reasons if the change didn’t occur.
Publish the workflow.
2. Assign a Workflow to a Case State Transition
The workflow created in the previous section must be assigned to a specific case and mapped to a particular state transition.
Set Logic for Customizing the State Transition: Define how the workflow will be assigned to specific cases. For instance, you can assign the workflow for all new cases.
Assign the Workflow: Use the Assign Workflow to State Change step. Specify the case ID, the target state for the transition, and the name of the workflow (which is automatically translated to the workflow ID).
Other available steps are: Get assigned workflow for state change and Unassign workflow from state change.Publish the Workflow: Publish the workflow to ensure it is active and functioning.
Make sure the state specified in the Assign workflow to state change step matches the state in the Change case state step in the first workflow.