Notification

nikhitha24
Tera Guru

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.

nikhitha24_0-1697459356964.png

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.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhitha24 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

 

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,'');

@nikhitha24 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader