- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 09:14 AM
I need the value in Approval For field because i have to send notification to the assignment group for Vulnerable Item & Remediation Task requested, approved & reject for Exception request.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 10:53 PM
you cannot set recipient using email script, only set CC and BCC
Is it the OOTB approval.inserted email which triggers
If yes then there you can add the logic in new notification and trigger it via event Queue on approval table
1) Ensure the OOTB "approval.inserted" notification doesn't trigger for your source table
2) Ensure the new notification triggers only for your source table and then trigger this via your new business rule on sysapproval_approver and specify your new event name
Something like this but please enhance as I am not aware of the table and fields
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var appr_Record = current.document_id;
var gr = new GlideRecord("sn_vul_change_approval");
gr.addQuery("sys_id", appr_Record);
gr.query();
if (gr.next()) {
var arr = [];
var vul_record = gr.vul_record.getRefRecord();
var assignmentgroup = vul_record.assignment_group.sys_id;
var groupMembers = new GlideRecord('sys_user_grmember');
groupMembers.addQuery('group', group);
groupMembers.query();
while (groupMembers.next()) {
arr.push(groupMembers.getValue('user'));
}
gs.eventQueue('eventName', current, arr.toString());
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 09:30 PM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader