modify system property with script action

will_smith
Mega Guru

Hi ServiceNow community!

I have set up a script action to modify the system property "collaboration.frameset", but am running into an issue where the system property is not updating upon logging in with a test user who has no roles. Can someone help me debug this?

have used this same method previously to modify a user preference and was hoping to do the same to scriptomagically disable the property with a role-based condition.

Thanks for taking a look at this for me.

Below is my script action...

find_real_file.png

1 ACCEPTED SOLUTION

will_smith
Mega Guru

Could it be that the ACL's are restricting access to the system properties for the user, therefore they cannot update the value?


View solution in original post

7 REPLIES 7

I want to point out that updating system properties frequently can cause system performance issues.   All of the properties are re-cached at any point that they change.   We learned that hard lesson less then a month after we went live by crashing our instance.


ghsrikanth
Tera Guru

Yes, that could be the case, the user with no itil - I really doubt they have write access to the sys_properties table.


One needed admin role to do that


maryellenniedzi
Kilo Explorer

Greetings -



You have a couple of considerations for this scenario:



- Script Actions execute as "system" (not system administrator) so your !gs.hasRole('itil') condition does not test against the user who triggered the event the Script action responds to.   This event's Parm1 value is the triggering user so you could move some logic into the script itself.   You'd have to script in the logic to see if the Parm1 user has the role of interest.



- I'm not familiar with this system property but won't setting it set the value for every user and not for an individiual user?



Good luck!