sending email to assignment group members

Deepika54
Tera Contributor

Hello experts,

 

From the script include i have the incident sysid. From the script include, I need to send an email to all the assignment group members.

 

Can anyone help me what to pass in the parm1 so that i can call the notification using gs.eventqueue

1 ACCEPTED SOLUTION

Shraddha Kadam
Mega Sage

Hello @Deepika54 ,

 

Use below script -

var groupMemeber = new GlideRecord("sys_user_grmember");
groupMemeber.addQuery("group.name=<YOUR GROUP NAME HERE>");
groupMemeber.query();

while(groupMemeber.next()){
    var param = {
        "approver_name" : current.approver.getDisplayValue(),
        "group_memeber_name": groupMemeber.user.getDisplayValue();
    }

    gs.eventQueue("<EVENT CREATED>", current, groupMemeber.user.toString(), param);
}
If my response was helpful, please mark it as correct and helpful.
Thank you.

View solution in original post

8 REPLIES 8

Mark Manders
Mega Patron

You can tick 'include members' on the group record and have the notification send to the assignment group. It will include the assignment group members automatically. No need to configure that in a script include.

 

For future reference: when asking for assistance with a script, it will always help if you share the script. In this case it's not necessary, because you don't need to change the script. And, depending on the requirement behind your question, you may not even need a script include.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

J Siva
Tera Sage

Hi @Deepika54 
From the Script Include, simply trigger the notification without passing the params.
Then, in the notification record's 'Who will receive' section, select 'Assignment Group' under the 'Users/Groups in Fields' option. So that, the email will be triggered to the assignment group memebrs of the current incident.

JSiva_0-1752657550749.png

Regards,
Siva

 

That only works when you set 'include members' on the group record.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Yes, that's correct. If the group record has a group email address defined, then the 'Include Members' option should be checked. This ensures that the email notification is sent to both the group email address and all individual group members.