How to send a email notification to user who reject the HR case ?

Deepika61
Tera Contributor

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

 

 

7 REPLIES 7

In that case you can add the user to parm2 and leverage that in the notification:

PeterBodelier_0-1697698684519.png

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier 

ok which person do i need to pass there like rejected person means whom did i add to that parm2?

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:

PeterBodelier_0-1697700125572.png

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.