How do you autoclose a case when an SLA it has is breached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 11:56 AM
Have set up an SLA to keep track of how long we wait for a customer to provide additional information.
Built a reminder to be sent twice before the clock expires and one that goes out informing the customer that the ticket has been cancelled when this SLA expires
Want to set SN to update the State field on the Case to Cancelled as soon as the SLA has Breached = true.
Trying to figure out how to set up a Business Rule (may not be the right answer) to automate this cancellation.
Thank you
Karina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:30 PM
- I configured a Business Rule on the task_sla table with the following conditions:
Please note that my business rule is looking for a specific Priority 1 resolution (5mins) to breach; of which I configured 5mins to breach.
- ...with the advanced script of:
(function executeRule(current, previous /*null when async*/) {
var incident = new GlideRecord('incident');
if(incident.get(current.getValue('task'))){
incident.setValue('state', 8); //cancelled
incident.comments = '[System Message] Incident cancelled by Business Rule.';
incident.update();
}
})(current, previous);
- Create an P1 incident. After 5mins if the P1 hasn't been resolved (on my instance), it should cancel.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2024 01:49 PM
Hi @Karina Baublits,
A Business Rule works but I would consider using a Flow/Workflow for a couple of reasons:
- Within the Flow/Workflow, you can also trigger a notification when the ticket has been canceled
- Scalability - reuse the Flow/Workflow when you need to apply the same logic to different SLA Definitions (with a BR, you may need to adjust the conditions every time a new definition is required)
- Since this is not a normal behaviour of the SLA Tasks, it may be safer to use a Flow/Workflow to separate them from other normal SLA Tasks
Cheers