State Transitions for Compliance Case Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Team,
I'm working on defining state transition rules for a compliance case in ServiceNow and would like feedback on best-practice implementation.
1)
When a compliance case is in the "Triage" state
And a user attempts to progress the case
Then the only allowed transition should be to the "Investigate" state but not canceled state
2)
Until unless all "action tasks" of compliance case are closed, compliance case can't be closed.
And give message that all tasks should be closed
3)
When case is in resolved state, while progressing further only 'closed' and 'post case review' option available
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Sriram28
1. Triage to Investigate Transition
Requirement: When in "Triage", the only allowed next state should be "Investigate" (not Canceled, Closed, etc.).
Best Practice: Use State Models (State Transitions).
Implementation: Navigate to State Management > State Models (or the State Transition table if using a Scoped GRC/Compliance app). Define a record where the Enter State is Triage and the only allowed Exit State is Investigate.
2. Block Case Closure Until Action Tasks Are Closed
Requirement: Prevent closing the compliance case if active action tasks exist, and show an error message.
Best Practice: A Before Update Business Rule.
Configuration:
Table: Your Compliance Case table (e.g., sn_compliance_case)
When: Before Update
Condition: State [Changes to] Closed (or your specific closed state value)
Advanced Script:
(function executeRule(current, previous /*null when async*/) {
// Query for any active child action tasks
var grTask = new GlideRecord('sn_compliance_action_task'); // Replace with your actual task table name
grTask.addQuery('parent', current.sys_id); // Assuming 'parent' or 'compliance_case' is the reference field
grTask.addActiveQuery(); // Checks for active=true
grTask.query();
if (grTask.hasNext()) {
// Display the message to the user
gs.addErrorMessage(gs.getMessage('All action tasks must be closed before the compliance case can be closed.'));
// Abort the database submission
current.setAbortAction(true);
}
})(current, previous);
3. Resolved State Restrictions
Requirement: When the case is in the "Resolved" state, the only available next options should be "Closed" and "Post Case Review".
Best Practice: State Models
State Model: Define a state transition rule where Enter State is Resolved, and the allowed Exit States are Closed and Post Case Review.
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards,
Bharat chavan