We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Moving ticket from closed state to Cancelled state

matteoR
Tera Contributor

Hello Community,

 

I need help with an issue regarding Change Requests.  A user backed out of implementing a change, and instead of entering it into the cancelled state put the ticket in the closed state. I am now unable to move it to the cancelled state. This error affects our reporting, and needs to be corrected. What can i do to correct this issue? The request, once in the closed state does not allow me to edit state, and even when trying to use business rules to force the state to cancelled I get error messages for "Invalid Update". Any help would be greatly appreciated. Thank you. 

1 ACCEPTED SOLUTION

Hemanth M
Tera Sage

Did you try using setWorkflow(false) ,

 

try below script in your  background script

var chg = new GlideRecord("change_request");
chg.get("1237f5de47410200e90d87e8dee490b8"); //replace this sys_id with closed change sys_id
chg.state=4; //set to canceled
chg.setWorkflow(false); //don't run any business rules/flows/SLAs
chg.update();

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026

View solution in original post

1 REPLY 1

Hemanth M
Tera Sage

Did you try using setWorkflow(false) ,

 

try below script in your  background script

var chg = new GlideRecord("change_request");
chg.get("1237f5de47410200e90d87e8dee490b8"); //replace this sys_id with closed change sys_id
chg.state=4; //set to canceled
chg.setWorkflow(false); //don't run any business rules/flows/SLAs
chg.update();

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026