Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Can I add a Roll back context record to track what my script has updated

Sagar Rd
Tera Contributor

By OOB Service Now provides Rollback Context, for the fix script are other.

 

My question is can we add the Rollback Context to manually track the changes.

 

For Example - I have a fixscript and if run the script by click of the Run Fix Script Button it creates a rollback context record.

 

For suppose if I want to run the script from the flow designer using the GlideScopedEvaluator and execute the script I need to create the rollback context record.

 

Please let me know your thoughts on this.

 

Thank you

2 REPLIES 2

yashkamde
Kilo Sage

Hello @Sagar Rd ,

 

By default, ServiceNow only generates rollback context records when you run Fix Scripts through the OOB runner. If you execute scripts manually, rollback isn’t tracked automatically.

To achieve the same behavior, you can use the GlideRollbackContext API in your custom logic. Wrap your script execution with start() and end(), and call addRecord() for each GlideRecord update. This way, you’ll create rollback context records programmatically, ensuring changes are tracked even when scripts are run outside the standard Fix Script UI.

 

Refer this :

https://www.servicenow.com/community/developer-forum/rollback-contexts/m-p/2023690 

 

If my response helped mark as helpful and accept the solution.

Tanushree Maiti
Giga Sage

Please refer this links, see if it helps you:

 

Rollback in flow designer - ServiceNow Community

 

Error Handling in Actions in Flow Designer - ServiceNow Community

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: