- 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
ā03-16-2022 01:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2022 12:58 AM
Hello Jwalton,
I tried above solution but I am not able to get the variable in who will receive.
- 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:23 AM
I have used below script in business rule and it is working fine
(function executeRule(current, previous /*null when async*/) {
var memberships = current.variables.responsible_service_managers.toString().split(",");
var serviceManagers = [];
for(var i=0; i<memberships.length; i++) {
var grMember = new GlideRecord('sys_user_grmember');
if (grMember.get(memberships[i])) {
serviceManagers.push(grMember.user.toString());
}
}
gs.eventQueue('servicemanager.email', current, gs.getUserID(), serviceManagers.toString());
})(current, previous);