Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to add group recipients to bcc

radhaidiotic
Kilo Contributor
Element

u_grp_rec_13

Reference

sys_user_group

15 REPLIES 15

Sailesh4
Giga Expert

Hi Guys,

This probably might be an old post. I was just checking for the similar one, and couldn't find the relevant code. Below is what I have written and it worked perfectly for me.

var a = new GlideRecord('sys_user_grmember');
a.addQuery('group', current.assignment_group);
a.query();
while (a.next()) {
    email.addAddress("cc", a.user.email, a.user.name);
}

If it works for you please mark it as closed and complete the loop.

Thanks,
Sailesh