- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-16-2022 12:42 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2022 03:41 PM
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-16-2022 09:41 AM
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.