reject person should not receive the notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
how to modify this script so that the ownership group members should receive the reject notification except the person from the ownership group who rejected it. This script is from create event in the workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Bhavani1995 ,
Could you Please try below script:
(function() {
// 'current' is the record that was rejected
var groupId = current.u_ownership_group; // Field holding ownership group sys_id
var rejectedBy = gs.getUserID(); // User who rejected
var grMembership = new GlideRecord("sys_user_grmember");
grMembership.addQuery("group", groupId);
grMembership.query();
var notifyUsers = [];
while (grMembership.next()) {
var userId = grMembership.user.toString();
// Exclude the rejected person
if (userId != rejectedBy) {
notifyUsers.push(userId);
}
}
// Trigger your event and pass recipients in parm1 or parm2
// Example: pass user list as parm1
gs.eventQueue("your.event.name", current, notifyUsers.join(','), "");
})();