SLA Pause and Stop conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
I have a requirement, where user requested to pause the sla on sc_task tickets when it is moved to closed complete state until 7 days from closed at time. After 7 days from closed at time it should complete the sla which is running. if in case user reopened the task, the same sla should run without tagging a new sla.
Is this can be achievable by condition builder or any other approach?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
To achieve this, you cannot use the standard Condition Builder alone because the SLA engine usually completes an SLA immediately when a "Stop" condition is met. You need a combination of a custom Pause Condition, a Scheduled Job, and a "Waiting" State.
1. Create a New State: "Pending Closure" (Optional but Recommended)
Instead of moving directly to "Closed Complete," move the task to a transitional state (e.g., Pending Closure).
2. Configure the SLA Definition
Go to your SLA Definition for sc_task and set the following:
- Start Condition: state is open (or your usual start).
- Pause Condition: state is pending closure. (This is the key. While in this state, the "Time Left" clock stops).
- Stop Condition: state is closed complete.
- Reset Condition: (Leave blank so it doesn't start a new one on reopen).
3. The "7-Day" Automation (Scheduled Job)
Since the SLA won't finish itself, you need a script to "push" the ticket from Pending Closure to Closed Complete after 7 days.
Create a Scheduled Script Execution:
- Run: Daily.
- Script:
var taskGR = new GlideRecord('sc_task');
// Find tasks in 'Pending Closure' where the 'Closed' (or a custom date field) was 7 days ago
taskGR.addQuery('state', '3'); // Assuming 3 is your 'Pending Closure' code
taskGR.addEncodedQuery('u_moved_to_pending_closure_atRELATIVELT@dayofweek@ago@7');
taskGR.query();
while(taskGR.next()){
taskGR.state = 4; // Move to 'Closed Complete' (The Stop Condition)
taskGR.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hi @SivaNagaM
Customization is required to achieve it .
- Custom Field: Add a u_closed_task (Date/Time) field to sc_task table
- In SLA definition
Pause on Close SLA Pause Condition: State is Closed Complete Resume on Reopen SLA Resume Condition: State is not Closed Complete - Set up a scheduled job that runs daily to identify sc_task records where the state is Closed Complete and the u_closed_task field is at least 7 days old. For those records, use a script to update the task_sla record to Completed.
