
- 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
‎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
‎12-12-2018 06:03 PM
Ohh, I see, I'll give this a try. Thanks Paul!
Regards,
Raph

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 06:11 PM
Hello Paul,
Will this work on previous records in which the Incident is already closed? lf I repair the JO SLA will the business rule still kick in on Closed Incidents already?
Regards,
Raph

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 09:36 PM
Repair SLA will pick it up.
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
‎12-16-2018 06:21 PM
Thanks Paul!