Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to temporarily make changes to script and avoid creating versions?

Suggy
Giga Sage

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?

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Giga Patron

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

View solution in original post

6 REPLIES 6

Not applicable

Hi @Suggy ,

 

There is no escaping , There isn't a direct way to disable versioning in ServiceNow for Business Rules. The system is designed to track changes for accountability. 

Chaitanya ILCR
Giga Patron

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

Ankur Bawiskar
Tera Patron

@Suggy 

you can play with the XML, export that business rule -> do changes in that BR by importing it in another instance -> export that BR from that instance and import in original instance. Follow the same process to revert the changes.

Note: This is not recommended and see if this workaround helps

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar I already tested it out, but the version related list is having a second entry.