Set the SLA breached field to true only when the SLA Resolution has breached

Edgar-d
Tera Contributor

Hello,

 

I have two SLAs associated with an incident. So how should I adjust (force) the SLA breached field in the incidents list to be set to true or false only when the SLA resolution field has been breached?

 

Edgard_1-1699561852233.png

Edgard_0-1699911508237.png

In my current case, the SLA breached field is set to true because the SLA response has breached. I want to change the logic so that the SLA Breached field remains set to false since the SLA resolution has not yet been breached.

 

Thank you!

1 ACCEPTED SOLUTION

AndersBGS
Tera Patron
Tera Patron

Hi @Edgar-d ,

 

This is not how SLA works. You either create a resolution or a response SLA which have there own set of criteria, target time etc. So basic, two different records that are not associated with each other.

 

If you would like only to look at the response SLA and not the resolution SLA for incident, you can deactivate the response SLA in the SLA definitions.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

2 REPLIES 2

AndersBGS
Tera Patron
Tera Patron

Hi @Edgar-d ,

 

This is not how SLA works. You either create a resolution or a response SLA which have there own set of criteria, target time etc. So basic, two different records that are not associated with each other.

 

If you would like only to look at the response SLA and not the resolution SLA for incident, you can deactivate the response SLA in the SLA definitions.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Edgar-d
Tera Contributor

Hi @AndersBGS,

 

Let's say I want to create two new custom fields (columns) in the incident list for a given case

  • SLA Breached Resolution (True/False)
  • SLA Breached Response (True/False)

Is it feasible to do this ?

 

I undestand your point regarding the way the SLAs should work. However, the business wants this change. They would like to keep both SLAs, but the SLA breached field on the incidents list should depend only on the value of the SLA Resolution has_breached field.

 

I found this BR : Set SLA breach on HR case. It manages the updating of the SLA Breached field value on the HR case. Can I change it to query only the SLA resolution value?

 

(function executeRule(current, previous /*null when async*/) {

	/*
	Sets SLA breached flag on HR case to reflect status on task_sla.
	Does not update sys_updated_* fields as there is no update to the HR case.
	Sets workflows off to prevent scripts from running on HR case update.
	*/
	
	var hrCase = new GlideRecord("sn_hr_core_case"); 
	if(hrCase.get(current.task.sys_id)) {
		hrCase.setValue("sla_breached", current.sla.has_breached);
		hrCase.autoSysFields(false);
		hrCase.setWorkflow(false);
		hrCase.update();
	}

})(current, previous);