once the catalog task is submitted the notification should not be sent to group manager

Aditya02
Tera Guru

After submission of Catalog task, Restrict the notification for group manager. Group members only have to receive the notification. How to perform this. where we include this restrictions for notification.

7 REPLIES 7

You can try this script

 

var users;
var group = new GlideRecord('sys_user_group');
group.get(current.assignment_group);

var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('group',current.assignment_group);
grmember.query();
while(grmember.next()){
if(!grmember.user==group.manager)
users.push(grmember.user.email);
}

gs.eventQueue('event_name',,users);// check the checkbox in notification that param1 contains recipients

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

piyushsain
Tera Guru
Tera Guru

Hi @Aditya02 ,

You can do this by triggering an Event in Insert BR on catalog task table. In the BR you can get all the members of the group excluding the manager and send the users via parameter

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

Ankur Bawiskar
Tera Patron
Tera Patron

@Aditya02 

so email should be sen to group members only

But what if group manager is also a member?

You will have to use eventQueue based approach, get the group members and exclude group manager and then send the email

what did you start with and where are you stuck?

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