How do you autoclose a case when an SLA it has is breached

Karina Baublits
Tera Contributor

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

 

2 REPLIES 2

Kris Moncada
Tera Guru
  • I configured a Business Rule on the task_sla table with the following conditions:
    KrisMoncada_0-1718407182276.png
    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.
    KrisMoncada_1-1718407728547.png

 

Hope this helps.

James Chun
Kilo Patron

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