I want to trigger a Script Action based on 'security.elevated_role.enabled' event.

pranavagarw
Tera Expert

Hi,

Whenever someone elevates their role to Security Admin, this event is triggered 'security.elevated_role.enabled'.
I want to use this event in a Script Action and do some operations.
But, I am unable to find this event.

pranavagarw_0-1770022976891.png

Why it is happening?
Or, Is there any other approach where I can perform some operations based on the role elevation.

Thank You.

7 REPLIES 7

sergiu_panaite
ServiceNow Employee

You cannot find the event name there since it is not registered as an event in the "Event Registry". You can only use script actions for registered events.

What kind of operations you want to do and at what stage (when event is inserted, after it is processed, etc)?

After it is processed, I want to build payload using Parm1 and Parm2 and then send it to a script include.

If it doesn't have to be real time you can run it as a scheduled job with a script that looks into sysevent for those events and does what you need.

Business rules on sysevent is probably not the best approach since that table should have no delays.

Ankur Bawiskar
Tera Patron

@pranavagarw 

yes that's not allowed to search there.

you can use after insert BR on "sysevent" table with condition as this

-> parm1 holds the user ID of the user who got elevated.

-> parm2 holds the value “security_admin"

AnkurBawiskar_0-1770023806711.png

 

AnkurBawiskar_1-1770023963964.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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