- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 12:54 AM
Hi Team,
How can you set up a notification in ServiceNow to alert a specific group when a user elevates their role to security_admin?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 12:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 01:08 AM
The problem
A user wants to trigger a notification when a user is elevated to the “security_admin” role. In the post:
-
They note that when a user is elevated to the role, an event with name security.elevated_role.enabled is generated. In that event:
-
parm1 holds the user ID of the user who got elevated. ServiceNow+1
-
parm2 holds the value “security_admin”. ServiceNow
-
-
They created a Notification (Send When → Event is fired → event name = security.elevated_role.enabled). ServiceNow
-
Then, they added an Advanced Condition Script to filter further:
function elevated() { var sysEventGr = new GlideRecord('sysevent'); sysEventGr.addQuery('sys_id', event.name.toString()); sysEventGr.query(); if (sysEventGr.next()) { if (sysEventGr.parm2 == "security_admin") { gs.print(sysEventGr.parm2); return true; } } }They expected it to check that parm2 == "security_admin" and only trigger if so. ServiceNow
-
The issue: Even though the script works when run in background, the Notification did not trigger when the role elevation happened in production. ServiceNow
🛠 The solution
A reply from a ServiceNow Employee suggests a simpler approach:
Which avoids querying the sysevent table entirely. ServiceNow
So instead of loading a GlideRecord, just use the event object directly in the Notification advanced condition.
So follow the below Article :-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 12:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 01:04 AM
is this a valid business requirement?
In PROD very limited set of users belonging to Particular Group will have security_admin role.
Why would they need this?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 01:08 AM
The problem
A user wants to trigger a notification when a user is elevated to the “security_admin” role. In the post:
-
They note that when a user is elevated to the role, an event with name security.elevated_role.enabled is generated. In that event:
-
parm1 holds the user ID of the user who got elevated. ServiceNow+1
-
parm2 holds the value “security_admin”. ServiceNow
-
-
They created a Notification (Send When → Event is fired → event name = security.elevated_role.enabled). ServiceNow
-
Then, they added an Advanced Condition Script to filter further:
function elevated() { var sysEventGr = new GlideRecord('sysevent'); sysEventGr.addQuery('sys_id', event.name.toString()); sysEventGr.query(); if (sysEventGr.next()) { if (sysEventGr.parm2 == "security_admin") { gs.print(sysEventGr.parm2); return true; } } }They expected it to check that parm2 == "security_admin" and only trigger if so. ServiceNow
-
The issue: Even though the script works when run in background, the Notification did not trigger when the role elevation happened in production. ServiceNow
🛠 The solution
A reply from a ServiceNow Employee suggests a simpler approach:
Which avoids querying the sysevent table entirely. ServiceNow
So instead of loading a GlideRecord, just use the event object directly in the Notification advanced condition.
So follow the below Article :-