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 force cancel change?

omkar2
Giga Contributor

I need to force cancel a change request, is there any script to it & where to run it?

1 ACCEPTED SOLUTION

change.setWorkflow(false); before your update(); statement.




var change = new GlideRecord('change_request');


change.get('<sys_id of change>');


change.setWorkflow(false);


change.state = 4;


change.update();


View solution in original post

13 REPLIES 13

Actually, I'm a newbie to snow


No worries.   We're here to help.   Check out my blog post ServiceNow Tips and Tricks for a ton of sites that will help you in your journey.


sure


Praveen55
Kilo Explorer

I have created a UI action with the below script to Cancel a Change request from New State, however, nothing happened. Kindly advise

 

 

var change = new GlideRecord('change_request');
change.get('<sys_id of change>');
change.setWorkflow(false);
change.state = 4;
change.update();