How to get variable fields to show up on RITM completed email notification

Midori_Cakes
Tera Contributor

Hello Everyone,

We have a few catalog items that either have a Reason for Request field or Business Justification field. I was wondering if there is a way to make it so when it sends the RITM Completion email and if one of these two field exists, that it shows up on the email being sent to the user?

Currently this is what I have for notification. I would like it to be added under the Reason field below. I am using a mailscript to do this:

THIS IS AN AUTOMATED MESSAGE - PLEASE DO NOT REPLY.

Hello ${request.requested_for},

Your request for ${cat_item} has been completed.

Request Number: ${request}

 

Requested Item Number: ${number}

Submitted Date: ${opened_at}

Requested By: ${opened_by}

Reason: ${mail_script:get_reasons}

Status: ${stage}

If you have questions or concerns regarding your request, please contact the Service Desk. Thank you!



Here is the Mail Script I have but I don't believe its correct:

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here

   
template.print("Business Justification " + request.business_justification.getDisplayValue());

})(current, template, email, email_action, event);



Can someone please help me fix this so I can achieve what I am trying to do?

Thank you!

0 REPLIES 0