The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Protection Policy for Script Include

snow_hard252
Kilo Contributor

Hi

I have accidentally set the Protection Policy of a Script Include to Protected, it now wouldn't allow me to make any changes

on script include form.Though I have the admin rights on the instance(Fuji version).

Can somebody tell me how to change this Protection policy ?

Thanks

Hardy

20 REPLIES 20

Hi Pradeep,



Thanks for the resonance, I hope it would also cause the error if we try using the script bv script background module.



Jayant


I was able to update the value via background script. I might need to check with the team on this one. Ideally, the script should have thrown an error.



var gr = new GlideRecord('sys_properties');


gr.addQuery('sys_id','3194ef10371120004f6a80f7bcbe5da2');


gr.query();


while(gr.next())


{


gr.value = true;


gr.setWorkflow(false);


gr.update();


}


cool seems to be loop hole.



Thanks,


Jayant


It certainly is a case of 'just because you can doesn't mean you should'.


Peter de Bock1
Mega Guru

Faced an issue with a Script Include from another Application scope cloned (Insert/Stay) into the Global scope. The Application scope was correctly changed to global, however the policy was accidentally copied across. With a background script I was able to remove the protection. Not recommended to perform this for the out of the box protected script includes to avoid upgrade issues.

Script used:

var gr = new GlideRecord('sys_script_include');
if (gr.get('ADD-SYS-ID-OF-YOUR_SCRIPT-INCLUDE')) {
    gs.print('found Script Include' + gr.name);
    gr.sys_policy = ''; //Just blank the protection
    gr.update();


Please mark this when its helpful