- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 10:57 PM
Hi All,
How to trigger notification if user added admin role using business rule? Kindly help me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 11:07 PM - edited 11-29-2022 11:08 PM
Hi @Debarpita ,
Create a BR as below :-
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.eventQueue('event.name', GlideRecord, parm1, parm2); // standard form
})(current, previous);
Create event from event registry and then create the BR.
After that create one notification as when event triggered and mentioned that event there.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 06:18 AM
one mistake . if any user added admin to any group it will trigger notification can u tell in which table i can find that.i will change the br table. Please help me as soon as possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 06:22 AM
Hello @Debarpita ,
if you want the table where the group roles get added then you can refer to sys_group_has_role table.
if you add a role to the group you can go to this table and check there will be a record present in the table
Hope this helps
Mark my answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 11:14 PM
Hi @Debarpita ,
You can go by this approach : https://www.servicenow.com/community/developer-forum/notify-by-email-when-user-allocates-admin-role/...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 11:35 PM
Why to use business rule when it can be done using without scripting using Flow designer?
You can also directly create notification on sys_user_has_role table with condition as Inserted=true and Role=admin
Give the correct email body and recipient.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 01:21 AM
Did you get a chance to check my above comment?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader