Send notifications to the group email of the child group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 02:13 AM
Hi All,
We have below requirement:
A catalog task is created from the workflow. The assignment group for this task is dynamic (based on one field on the RITM). Whenever this task is assigned to any group, we need to send notification to the group members along with some DLs. These DLs are not fixed, and will vary based on the assignment group.
We need only one common notification sent to all the group members and DLs.
We tried creating a child group, and adding the respective DL in the 'group email' field of the child group. However, the DL address is not coming in the recipients list.
Please let me know in case if there is any other way to achieve a similar functionality.
Thanks & Regards,
Kalyani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 03:42 AM
You can write a notification email script and can use addAddress API to add more email address.
syntax : addAddress(String type, String address, String displayname). Type can be cc or bcc.
${mail_script:scriptname} is the syntax to call mail script in the body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 04:40 AM
One possible solution to achieve this functionality is to use a Business Rule that triggers when the task assignment group is updated.
In the Business Rule script, you can retrieve the assignment group, lookup the relevant DLs based on the assignment group, and construct a notification message to be sent to the group members and DLs.
(function executeRule(current, previous /*null when async*/) {
var assignmentGroup = current.assignment_group.getDisplayValue();
// Lookup the DLs based on the assignment group
var dl1 = getDLForAssignmentGroup(assignmentGroup);
var dl2 = getAnotherDLForAssignmentGroup(assignmentGroup);
// Construct the notification message
var message = "A new task has been assigned to the " + assignmentGroup + " group. Please take necessary action.";
// Add the DLs to the recipient list
var recipientList = [];
recipientList.push(dl1);
recipientList.push(dl2);
// Send the notification
gs.eventQueue("email", current, gs.getUserID(), null, message, recipientList);
})(current, previous);
In this example, you would replace getDLForAssignmentGroup and getAnotherDLForAssignmentGroup with functions that lookup the relevant DLs based on the assignment group.
Note that the recipient list must be an array of email addresses, so if your DLs are not resolving to email addresses, you may need to modify the code accordingly. Also, make sure that the assignment group field is set to Notify in the catalog task definition to trigger the Business Rule when the assignment group is updated.