- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 09:03 AM
Hello,
I have a requirement, i need to send notification to all users of a particular group as CC.
anyone can help me on this
thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 09:09 AM
you will have to use email script and then iterate over sys_user_grmember table and use this line
email.addAddress("cc", "email", "name");
something like this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "Group ABC");
gr.query();
while (gr.next()) {
email.addAddress("cc", gr.user.email.toString(), gr.user.getDisplayValue());
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 09:09 AM
you will have to use email script and then iterate over sys_user_grmember table and use this line
email.addAddress("cc", "email", "name");
something like this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "Group ABC");
gr.query();
while (gr.next()) {
email.addAddress("cc", gr.user.email.toString(), gr.user.getDisplayValue());
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2025 10:58 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2025 08:27 AM
Hello @Ankur Bawiskar ,
Thanks for the immediate response
Tried the above script but it is not working, i do not see recipients in Copied on emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2025 08:57 AM
Hello @Ankur Bawiskar ,
script worked
thanks a lot