Send notification to user selected in list collector

Nisha28
Tera Contributor

Hello All,

I have requirement to send the notification to all those user which are selected in list collector on catalog task.

This notification should trigger when the task is closed complete .

I have tried this sending the notification through workflow attached to catalog item 

and in the notification script  i used below code .but it is not sending the notification but when selected one user in To field it is sending the notification but for below code it is not working

answer = current.variables.responsible_service_managers.toString().split(',');

Thanks 

 

1 ACCEPTED SOLUTION

Hi Nisha,

I totally missed you were trying to use a catalog variable.  In this case you can create an async business rule on the sc_task table that triggers when the catalog task is closed complete.  The business rule will then create an event for the email notification.

ref: Setup email notification using Business rule.

example business rule:

find_real_file.png

find_real_file.png

View solution in original post

5 REPLIES 5

What are you trying to do there in the script?  You want to check to see if the User is in a particular Group?  But you are not specifying a Group to search in.  You're just searching to see if they are in any group.  And the "grMember.get(memberships[i])" shouldn't even return anything for you.

If you just want to send the email to the Users in the list, this should work:

 

(function executeRule(current, previous /*null when async*/) {
    gs.eventQueue('servicemanager.email', current, gs.getUserID(), current.variables.responsible_service_managers.toString());
})(current, previous);

 

The list collector stores the info as a comma-separated string, which is what you can specify in the 4th parameter of the method.