We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

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