SLA's on REQ, RITM or SCTASK

steve_turley
Tera Contributor

Is there a best practice for where the 'Request' SLA should be located? 

 

We have a requirement to have a standard Request SLA for any Request Item. However, what it must do is pause when any of the linked SCTASKS are in a 'pending' state and then restart when none of the linked SCTASKS are pending.

 

We've attempted this using business rules but it has caused problems with Items with multiple tasks.

 

Thanks!

 

 

5 REPLIES 5

RaghavSh
Kilo Patron

You can apply SLA on RITM table.

 The main point to note here is when your task (one or more) based on your requirement should set the state or stage of RITM as pending. And based on the RITM state you can drive your SLA.

 

You can also have SLA on sc tasks as well. The advantage here would be that sc_ task are assigned to some assignment group and it becomes the responsibility of assignment group to adher to SLA timelines. RITM on other hand does not have assignment group so your purpose of SLA may be defeated.


Raghav
MVP 2023

@steve_turley were you able to solve this?


Raghav
MVP 2023

Ahmmed Ali
Mega Sage

Hi @steve_turley 

 

Is there a best practice for where the 'Request' SLA should be located? -- As per my understanding, it is always based on business requirement. Since we mostly will have multiple SCTASKs, it is ideal to have it on request_item.

 

Regarding the SLA configuration, below is one of the solutions you can try:

 

- Create new check box type field on requested item table with name as "SLA paused"

- Update your SLA pause condition as "SLA paused is True"

- Write after/Async business rule on SCTASK table to update the "SLA paused" field. typical BR like below:

Conditions: State changes to pending OR state changes from pending

script:

//Assuming pending date value as 6, verify the same

var grReq = new GlideRecord("sc_req_item");

if(current.state == "6"){

	grReq.addQuery("sys_id", current.request_item);

	grReq.query();

	if(grReq.next()){

		grReq.SLA_PAUSED_FIELD_NAME = true;

		grReq.update();

	}

}

else{

	var grTask = new GlideRecord("sc_task");

	grTask.addQuery("request_item",current.request_item);

	grTask.addQuery("state","6");

	grTask.setLimit(1);

	grTask.query();

	if(grTask.next){

		grReq.addQuery("sys_id", current.request_item);

		grReq.query();

		if(grReq.next()){

			grReq.SLA_PAUSED_FIELD_NAME = true;

			grReq.update();

		}else{

			grReq.addQuery("sys_id", current.request_item);

			grReq.query();

			if(grReq.next()){

				grReq.SLA_PAUSED_FIELD_NAME = false;

				grReq.update();

			}

		}

	}

}

 

Note: Verify field names and back-end values

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi @Ahmmed Ali - thanks!

 

This almost works, but it doesn't uncheck the SLA_paused field when I move the sctask state from 'pending' and thus, doesn't unpause the SLA

 

Thanks

 

Steve