Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

move business rule from global to application scope

gflewis
Kilo Expert

I have a business rule on a table that is owned by an application.   The scope of the business rule is global (sys_scope=='global').   How can I change it to application scope?

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

you can use background scripts to do that:



var br = new GlideRecord('<business rule table>');


br.get('<sys_id of your BR>');



br.sys_scope = '<your app scope>';


br.update();


View solution in original post

6 REPLIES 6

The SN Nerd
Giga Sage
Giga Sage

ServiceNow doesn't let you move Global Scope assets to an individual application because the Scoped API is a subset of the Global API, so moving it could break your code.



You really need to recreate the business rule in the application and re-write the code using the scoped API.



List of Scoped Scriptable Objects - ServiceNow Wiki



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

gflewis
Kilo Expert

Thanks Paul Morris for the explanation and Mike Allen for a workaround to circumvent the system.