Protection Policy in Script include for Scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 06:37 AM
Hi,
In an scoped application, Protection policy of a Script Include has been set to Read -Only by mistake and moved to Test instance, now I am not able to change the Protection Policy from Read-only to None in test instance .
Do anyone have idea ,how to chnge the Protection policy back to None.
Thanks
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 06:53 AM
HI,
Just run this script in background as admin:
var gr = new GlideRecord("sys_metadata");
gr.get("120c9e354f994200e38d27118110c7d8");//This should be the sys id of the script include
gs.print(gr.sys_policy);
gr.sys_policy="";
gs.print(gr.sys_policy);
gr.update();
Thakns,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 07:07 AM
Hi Deepika,
run below script using script background
var gr = new GlideRecord('sys_script_include');
if (gr.get('add sys id of script include')) {
gs.info('found Script Include' + gr.name);
gr.sys_policy = ''; //remove protection
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:26 AM
Hi Deepika,
Good Day! Please do write the fix script with below code, and run the same. It should works 🙂
var gr = new GlideRecord('sys_script_include');
if (gr.get('add sys id of script include')) {
gr.sys_policy = ''; //remove protection
gr.update();
gr.deleteRecord(); --> add this line if you want to delete the record else you can set the value as empty
}
Thanks,
Priyanka R