Getting ${URI_REF} to display incident number

StephenL1
Tera Contributor

Hey,

I've set up email notifications for our team to get an email when an incident has breached SLA. 

find_real_file.png

Currently if I send the email it will display the incident short description instead of the number. I've tried changing the table to incident, and using incident.number.URI_REF/task.number.URI_REF but nothing. Also checked the TASK dictionary entry and switched override display from true to false but it made no difference.

 

It's only a small detail but I'm interested in learning how to change it. Would really appreciate any help 🙂 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Stephen,

 

You need to create notification email script from System Notification  >> Email >> Notifiation Mail script as below.

Name: gettasknumber

(function runMailScript(current, template, email, email_action, event) {

    template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=task.do?sys_id=' + current.task.sys_id + ' ">' + current.task.number + '</a>');
	
})(current, template, email, email_action, event);

 

Call it in notification body in format

${mail_script:gettasknumber}

 

${URI_REF} will work for current table's display value. For Task SLA (task_sla) table display value is not number field.

View solution in original post

21 REPLIES 21

Yes that make sense, Glad that you found the solution 🙂

I didn't have to change it with this script.

Harsh Vardhan
Giga Patron

 ${task.URI_REF} should work. 

 

Tested

 

find_real_file.png

 

 

This is cool the way you embedded the gif/other format file, can you tell me how you created that file?

you can try with "GIF Screen Recorder" software