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 cancel custom task SLA using fix script

Kiruthika J
Tera Contributor

Hi All,

How to cancel custom Task SLA, I have Imported OOB SLA definition and made custom SLA active false.

Note: both OOB and custom SLA are running on the same Workflow.

Table: incident

Thanks!

1 REPLY 1

Musab Rasheed
Tera Sage

Hi,

Please take this sample script and modify accordingly.

var gr = new GlideRecord('task_sla');
gr.addQuery('task' , 'STARTSWITH', 'INC');
gr.addQuery('stage', 'inprogress');
gr.query()
while(gr.next())
{
gr.stage = 'completed';
gr.setWorkflow(false);
gr.update();
}
Please hit like and mark my response as correct if that helps
Regards,
Musab