Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Stop SLA timer

Ashish Raj
Kilo Contributor

Hi Developers 

 

I need your help in one particular case .

 

In my instance i have one SLA which is running even if the ticket is in cancelled state .

To stop the SLA i wrote one background script to change the stage of the task_sla table record for the particular SLA .

 

My script is 

var gr=new GlideRecord('task_sla');
gr.get('sys_id value');
gr.stage='completed'; 
gr.update();

 

This is changing my SLA's  Stage value to completed but still the timer is not stopping .

SLA is still progressing in time .

Need your help to figure this out .

 

Thanks and regards

Ashish 

6 REPLIES 6

Mike Patel
Tera Sage

You can add condition under stop sla defination when ticket status is cancelled. 

find_real_file.png

find_real_file.png

Hi 

 

Its not the SLA definition i want to stop ,

 

I have one sla which is attached to one ticket .

I want to stop the SLA for that particulat ticket only .

I am able to change the state of the ticket but timer is not stopping .

I have SLA definition set to stop when ticket is cancelled or closed , it is working fine for rest of the tickets but not for one particular ticket .

arielgritti
Mega Sage

Hello Ashish

You must add the condition in the SLA definition to stop the timer

Ariel

Ashish Raj
Kilo Contributor

Hi 

 

Its not the SLA definition i want to stop ,

 

I have one sla which is attached to one ticket .

I want to stop the SLA for that particulat ticket only .

I am able to change the state of the ticket but timer is not stopping .

I have SLA definition set to stop when ticket is cancelled or closed , it is working fine for rest of the tickets but not for one particular ticket .

 

regards

Ashish