
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 02:18 AM
Hello guys,
I am having a hard time figuring out what's wrong with my SLA stop condition as it does not seem to move into 'Completed' Stage.
Here is my Stop Condition, the SLA should Stop after the Incident is Closed.
Here is my paused condition, The SLA will pause when the 'Job Order' is in 'Pending, Engineer on Transit, Resolved, Closed, Cancelled and Closed Incomplete'.
My thoughts are the stop condition cannot locate the right 'State' values in incident because they are in Integer but when I use a business rule in Job Order to Auto-close the Incident the SLA is changing to 'Completed' Stage.
The value of 'Closed' in Incident is 36 but when I search it in Stop condition filter, it's not there
Is there a way to change the choices to integer when choosing the stop condition filter?
Here is a sample of the Process
If the JO is closed
Then once the Incident is Closed
The Task SLA of JO should be completed
Any help is gladly appreciated. Thank you.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 05:56 PM
The SLA engine will only run if the record gets updated (Job Order).
So, when the Incident status changes to close, the SLA will not recalculate the conditions until the Job Order record is saved.
You could work around this by adding an After Business rule on Incident:
When Status change to closed
Look up the related Job Order and add something to the work notes (or use forceUpdate) to make the SLA recalculate.
Something like this:
var grJob = new GlideRecord('your_table_name_here');
if(grJob.get('incident',current.getValue('sys_id'))) {
grJob.work_notes = "Incident closed, Stopping SLA");
grJob.update();
}
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 07:24 PM
Hello Paul,
How can this script be modified in order to update multiple child incidents/work notes so that when an Incident is closed, it will auto populate not just one ticket because I encountered a problem wherein it only stopped one SLA Task because only one ticket was updated by this business rule and the other child ticket was stuck in paused state. Thank you.
Regards,
Raphael