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.

How to stop running sla

ronaldanand
Tera Contributor

Hi

    How to stop my running sla. please someone guide me

5 REPLIES 5

phillipmelmoth
Mega Expert

I think this should do the trick in a background script or such



var taskSLA = new TaskSLA(/* sys_id or task_sla GlideRecord */ task_sla);


taskSLA.setUpdateTime(/* glide_date_time, GlideDateTime or string "Value" */ end_time); //Optional if you want to set the end_time to calculate from


taskSLA.updateState(TaskSLA.STATE_COMPLETED); // or TaskSLA.STATE_CANCELLED