Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 05:32 AM
Hi Team,
Can someone please help me on the below query.
I have created one report i want to send a different notifications to individual user. i.e, This many tasks are assigned to you name.
EX: if Shivangi is HM for 5 candidates and 5 tasks are pending for all 5 candidates she will get 25 separate email notifications.
we are planning to send one notifications for each hiring manger with pending tasks, which will have list of pending tasks for candidates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 05:37 AM
check this link and it has solution shared by me.
enhance it as per your requirement
How to trigger multiple notifications for multiple users ?
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
10-17-2023 07:59 AM
We have write the script but the mail is not triggered.
Please help me on this.
var tableName = 'sn_hr_core_case';
var managerField = 'opened_for';
var aggregate = new GlideAggregate('sn_hr_core_case');
aggregate.addAggregate('COUNT');
aggregate.groupBy(managerField);
aggregate.query();
if(aggregate.next()) {
gs.log('manger_id:'+aggregate.opened_for.email);
var manager = aggregate.getValue(managerField);
var count = aggregate.getAggregate('COUNT');
gs.eventQueue('sn_hr_core.test_digest_hm', aggregate, aggregate.opened_for.email,'');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 08:30 PM
eventQueue function requires GlideRecord object, but you are sending GlideAggregate object
So query that case table with sysId using GlideRecord and then use that object and that record's opened_for in eventQueue function
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader