How to trigger notification if user added admin role using business rule

Debarpita
Tera Contributor

Hi All,

 

How to trigger notification if user added admin role using business rule? Kindly help me 

1 ACCEPTED SOLUTION

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Debarpita ,

Create a BR as below :-

GunjanKiratkar_0-1669792008827.png

 

(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

View solution in original post

12 REPLIES 12

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

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

Community Alums
Not applicable

Ankur Bawiskar
Tera Patron
Tera Patron

@Debarpita 

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.

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

@Debarpita 

Did you get a chance to check my above comment?

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