- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 01:35 AM
I need to temporarily make changes to a script (say a Business rule) and avoid creating versions.
Post my testing, I will revert it to original state. I dont want any versions/traces.
Is it possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 01:53 AM
Hi @Suggy ,
whatever changes you are doing to them via Background script or fixscript with setworkflow false
or you can use update jobs with run business rules false
var current = new GlideRecord("sys_script");
if (current.get("67014acbc39d6610051cb132b4013192")){
gs.info(current.getDisplayValue());
}
current.name ='test';
current.setWorkflow(false)
current.update()
example I have updated name of a BR with setWorkflow(false) it did not create a version
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 03:02 AM
check the script which @Chaitanya ILCR shared but remember setting the script field is tedious as it's a script type field
see if that works for you
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 03:27 AM
That should be fine @Ankur Bawiskar @Suggy
use Template literals take the edited script and wrap them using the backtick(`)
var current = new GlideRecord("sys_script");
if (current.get("67014acbc39d6610051cb132b4013192")) {
gs.info(current.getDisplayValue());
}
current.script = `(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.warn('usr query '+gs.action.getGlideURI().toString())
if(gs.action.getGlideURI().toString().contains('api/now/form/mention/record/')){
gs.warn('usr query inside gs.action')
current.addNullQuery('sys_id')
}
//hello test
})(current, previous); `
current.setWorkflow(false)
current.update()
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya