- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 08:20 AM
Hi,
As per previous comment it was working fine.
I think since you have hard-coded the user in email so it is coming.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 08:42 AM
Sure Ankur.please check it once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 10:00 AM
Hi,
I just updated the job code
It triggered 3 emails to 3 different users
Email triggered to David Loo has incident info Assigned to David Loo
Email triggered to Rosie Mathews has incident info Assigned to Rosie Mathews
Email triggered to Fred Luddy has incident info Assigned to Fred Luddy
Now the only thing you need to check is why it didn't send email to other 6 users
Updated Job Code:
sendEmail();
function sendEmail() {
var gr = new GlideAggregate("incident");
gr.addAggregate("COUNT");
gr.addEncodedQuery('active=true^assigned_toISNOTEMPTY');
gr.groupBy("assigned_to");
gr.query();
while(gr.next()) {
var user = gr.assigned_to;
var incRec = new GlideRecord('incident');
incRec.get('assigned_to', user);
gs.eventQueue('test_list', incRec, incRec.assigned_to, incRec.assigned_to);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 11:08 AM
Thanks ankur, it is working fine now.
Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 11:52 PM
You are welcome
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader