Caller field not populating via email script residing inside the email notification for the incident

gthapa
Tera Contributor

Hello community,

 

I have a notification configured to trigger upon incident creation. All fields populate correctly in the notification, except for the Caller field, which remains empty.

The email script used in the notification is scoped to global, and I’ve reviewed it without finding any obvious issues. I'm unsure why the Caller information isn't appearing as expected.

I've attached and included screenshots of the email script, notification preview, and the notification configuration for reference.

Could someone help determine whether the issue lies within the email script itself, and suggest possible steps to resolve it

 

gthapa_0-1756853852287.pnggthapa_1-1756854000974.pnggthapa_2-1756854056645.png

 

5 REPLIES 5

Rafael Batistot
Kilo Patron

Hi @gthapa 

This explanation might help you 

 

In a Mail Script (ServiceNow), if you want to get the caller of the record (for example, in an Incident notification), you can do it like this:

// 'current' is the record that triggered the notification
var caller = current.caller_id;

// Get the display value (name)
template.print(caller.getDisplayValue());

// Or, if you need the caller's email:
var callerGR = current.caller_id.getRefRecord();
template.print(callerGR.email);

 

 

Explanation:

  • current.caller_id → reference field to the user (sys_user).

  • .getDisplayValue() → gets the user's display name.

  • .getRefRecord() → fetches the full user record, so you can access other fields like email, phone, etc.

Example output in your email:

kaushal_snow
Mega Sage

Hi @gthapa ,

 

Ensure Proper Access to the caller_id Field

In your email script, access the caller_id field using dot walking....

 

var caller = current.caller_id;
template.print(caller.getDisplayValue());


If current.caller_id is empty, it indicates that the caller_id field isn't populated on the record triggering the notification.....and then ensure that the caller_id field is populated on the incident record. If it's empty, the email script won't have any data to display....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Ankur Bawiskar
Tera Patron
Tera Patron

@gthapa 

did you try printing outside what value came in that field using gs.info();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

rajesh9885
Mega Guru

Can you confirm the table. SIR do you mean sn_si_incident or is it on SIR Task sn_si_task..

SIR table does not have caller id it will render blank.

 

Can you confirm the mapping on the template

is it ${caller_id} if yes change it to Caller: ${reported_by}