How to add rejection comments in the notification sent when a request is rejected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 10:21 AM
Hi All,
We have existing notifications set up on sysevent_email_action table to trigger an email when a request is rejected. The requirement now is to include the rejection comments to be captured in this email notification. Please note the comment is mandatory while rejecting a request. I am unable to find the correct option to be selected here. I am trying this on sc_request and sc_req_item tables.
any guidance on how to achieve is greatly appreciated.
Thank you
Atheher Fathima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 05:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 01:28 AM
Hi @Atheher Fathima ,
You can setup a new email script in the table [sys_script_email] and call it in the already setup notification.
The email script can be called in notification as below
${mail_script:<name_of_email_script>}
Code for the email script:
var getRejectionNotes = new GlideRecord('sysapproval_approver');
getRejectionNotes.addQuery('sysapproval', current.sys_id);
getRejectionNotes.query();
if(getRejectionNotes.next())
{
template.print("Rejection Note(s): " + getRejectionNotes.comments.getJournalEntry(1));
}
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Mark this as Helpful / Accept the Solution if this helps.