Can I add a Roll back context record to track what my script has updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Please refer this links, see if it helps you:
Rollback in flow designer - ServiceNow Community
Error Handling in Actions in Flow Designer - ServiceNow Community
