How to send a email notification to user who reject the HR case ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 10:53 PM
Hi All,
we have notification that whenever case is rejected an state closed incomplete then sent a notification to "subject person , watch list and opened by " but need to send the user who reject the HR case?
So can you please suggest me that how to add the user who reject the case as recipient?
Thanks
Deepika

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 11:58 PM
In that case you can add the user to parm2 and leverage that in the notification:
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 12:08 AM
ok which person do i need to pass there like rejected person means whom did i add to that parm2?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 12:24 AM
You could use the following script:
var grSA = new GlideRecord('sysapproval_approver');
grSA.addQuery("state", "rejected");
grSA.addQuery("document_id", current.getUniqueValue());
grSA.orderByDesc('sys_updated_on');
grSA.setLimit(1);
grSA.query();
if (grSA.next()) {
return grSA.getValue("approver");
}
else{
return ""
}
And to be complete, depending on your configuration, it could also be that you would need to do this in the approval action itself:
In that case insert below script between in line 15, and add variable rejected_by to the current line 20 as last option instead of null.
var rejected_by = null;
var grSA = new GlideRecord('sysapproval_approver');
grSA.addQuery("state", "rejected");
grSA.addQuery("document_id", current.getUniqueValue());
grSA.orderByDesc('sys_updated_on');
grSA.setLimit(1);
grSA.query();
if (grSA.next()) {
rejected_by = grSA.getValue("approver");
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.