- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 10:50 AM
Hey,
I've set up email notifications for our team to get an email when an incident has breached SLA.
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 🙂
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 11:09 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 12:13 PM
I am assuming you have some reference field which refer to incident table and see on that field, are you seeing incident number or incident short description. because this is not expected behavior,
${task.URI_REF} works. Need to dig into your instance to check field configuration on incident table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 12:18 PM
Ya that definitely makes sense. I think I'll just have to spend the time digging in as the the person who set it up is no longer here, so I'm diving in to learn.
Appreciate your help though!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 12:26 PM
Happy learning.
Let me know if you need any further help here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 11:09 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 11:10 AM
it will work using ${task.URI_REF}