Email notification is being sent with empty variables

Bonnie1
Mega Contributor

Hi All,

This is not at all related to change/problem management but I am posting the query under change/problem management since I didn't know what module the customized applications come under.

We have a customized application called 'Employee Transfer' which extends task table. Below is the functionality of the transfer ticket:

It has a workflow attached. Whenever a new record is created in this table, it is directly sent for approvals based on particular field values. And there is an approval notification scheduled to be sent as soon as the record is inserted. The notification pulls few of the field values of transfer ticket and sends it to the approver user.

The email is being sent as expected in all the cases except in some rare scenarios. The ticket variables are missing in the email body for few scenarios. Also tried to find if this is happening for any particular user or role or any particular field values. But couldn't find any fixed pattern for this. 

Attaching the screenshot of the email notification created in servicenow and the email with empty variables sent to some of the users.

As we are not seeing this issue is all the scenarios, I'm unable to replicate the issue in lower environment to troubleshoot. Can someone please suggest me the ways to trace the cause here.

Thanks in Advance !!

4 REPLIES 4

Harish KM
Kilo Patron
Kilo Patron

Hi The script in your email notification should be like this

 current.sysapproval.variables.variablename 

are you using email script or templates?

Regards
Harish

Hello, We are using an email notification for this directly. Please find the attached screenshot for email notification

Ok then your script should look like this

Variable test  : ${current.sysapproval.variables.reason} // reason is the variable name can pass directly to your notification. 

Notification table name : approver table

Regards
Harish

Actually I am looking for ways to trace the issue with the existing script below as it works fine for all cases except for few scenarios..

Below is the current script in the email notification on table - 'sysapproval_approver':

Please approve or reject ${sysapproval} based on the details below:
<b>Employee</b>: ${sysapproval.u_user.name}
<b>Effective Date</b>: ${sysapproval.u_transfer_date}
<b>New Hitachi Job Template</b>: ${sysapproval.u_new_hitachi_job_template}