- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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
6 hours ago
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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 :-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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 :-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
