Site Name Missing in Email Notifications From ServiceNow

ServiceNow Use6
Tera Guru

Hi,

I have a request
Could you please include the Site filed as mandatory inclusion in Email notifications such as the below:

Please do not limit the Site inclusion to CINC only but to all ServiceNow work records.

I have completed the work but it works for this notification only, request is to make it work to all ServiceNow work records.

1.png

 

2.png

 

3.png

 

4.png

 

Incident Number: ${mail_script:C8TKT Ticket Commented link to SP}

Subject: ${short_description}

Severity Level: ${priority}

Site (Location): ${location.name}  

Requestor: ${opened_by.name}.

Description:

${description}

 

Regards

Suman P.

 

 

8 REPLIES 8

If your notification is on incident table, then

use following line in Message HTML

${location.site}

 

You can use Notification script as well

Name : name_of_your_script

 

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

{ if (current.location)

{

template.print("Site: " + current.location.site + "\n");

}

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

 

Call notification script in email body : ${mail_script:name_of_your_script}

 

 

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

Ankur Bawiskar
Tera Patron

@ServiceNow Use6 

so you included location field on email

what's your query then?

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

Hi @Ankur Bawiskar,

I have completed the work but it works for this notification only, request is to make it work to all ServiceNow work records.

Regards

Suman P.

@ServiceNow Use6 

Ask customer team which all notifications they want the location to be included

Their requirement should be specific and not generic.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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