Rejection comments are not showing

Gopal14
Tera Contributor

Hi,

 

Rejection comments are not attaching in the email notification for Requested Items

 

Gopal14_0-1777891897785.png

 

Notifications:

Approval Rejected - OOTB notification, It is not working

Approval Rejected By Other - OOTB notification, It is not working

 

Both above are on sysapproval_approver table

 

Comment left on request - OOTB notification, Rejection comments are showing here.

 

Gopal14_1-1777892062152.png

 

 

On sysapproval_approver notification rejection comments are not showing.

 

 

 

Gopal14_2-1777892192567.png

 

 

Gopal14_3-1777892229685.png

 

 

Gopal14_4-1777892258072.png

 

2 REPLIES 2

Tanushree Maiti
Kilo Patron

Hi @Gopal14 

 

When a request is submitted for approval and once is approved at first and then it goes to 2nd level approval and when the 2nd level approver rejects the target record the email is triggered but the rejection comments are unavailable to be included in the notification. This works fine when the first level approver rejects the article.

Refer:  KB KB0786276 Reject comments not displayed in email notification for Knowledge article or any table rec... 

 

Can you confirm , for your case , it is 1st level approval?

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hi @Gopal14 

 

Just try once with  email script

Navigate to sys_script_email.list

   create a new record .

   name :get_rejection_comments

   and call it in your notification using  ${mail_script:get_rejection_comments}

 

sample script:

var rejectComment = new GlideRecord('sys_journal_field');
rejectComment.addQuery('element_id', current.sys_id);
rejectComment.addQuery('element', 'comments');
rejectComment.addQuery('name', 'sysapproval_approver');
rejectComment.orderByDesc('sys_created_on');
rejectComment.query();
if(rejectComment.next()){
template.print('Rejection Comments: ' + rejectComment.value + '\n');
}

 

Note:  Ensure the notification triggers after the state changes to rejected

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: