How to send notifications to users selected in List collector variables on catalog items

kumaraj
Kilo Sage

Hi Friends,

Could you please help me to find the below solution.

My requirement : How to send notifications to users selected in List collector variables on catalog items shown below:

below screen is of RITM which shows variable has 3 users selected, so how can we send notification of RITM submition to them?

find_real_file.png

we could have add notification in workflow but due to some reason we are not supposed to modify the workflow.

Can anyone suggest me how to achieve this requirement, if you provide it in bit details and code(if required) then would be better.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

best way is you can use workflow notification activity and in the advanced script get the users and push to answer array

sample script;

answer = current.variables.<listCollectorVariable>.toString().split(',');

another approach would be have after insert BR on sc_req_item table and condition as catalog item is yours; so that it triggers only for your catalog item

create event in event registry for sc_req_item table

create notification on sc_req_item table and associated the event to this notification

ensure below

1) event parm 1 contains recipient checkbox is set to true

2) send to event creator is true

in BR script use this

gs.eventQueue('event_name', current, current.variables.<listCollectorVariable>,'');

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

best way is you can use workflow notification activity and in the advanced script get the users and push to answer array

sample script;

answer = current.variables.<listCollectorVariable>.toString().split(',');

another approach would be have after insert BR on sc_req_item table and condition as catalog item is yours; so that it triggers only for your catalog item

create event in event registry for sc_req_item table

create notification on sc_req_item table and associated the event to this notification

ensure below

1) event parm 1 contains recipient checkbox is set to true

2) send to event creator is true

in BR script use this

gs.eventQueue('event_name', current, current.variables.<listCollectorVariable>,'');

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

This works perfectly, but how can we send the notifications to individual users separately?

Priyanka Chandr
Mega Guru

Hi,

 List collectors already save users in a comma separated list as required by notifications.

 Try this one 

answer = [];

answer.push(current.variables.users_needing_access);
 

kumaraj
Kilo Sage

We have to implement it to more that 50 worflows so we are not touching that.

I am trying to trigger event notification from catalog client script and script include using AJAX.