- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 10:04 AM
In the email notification, I have this text in the body 'Order task Number: ${number} on order line number: ${order_line_item} is on hold and needs to be retriggered.'
how can I make this task number hyperlink and when clicked it should go to that particular task?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 10:42 AM - edited 01-27-2023 10:43 AM
Method 1:
In your case, text should be:
Order task Number: ${URI_REF}
Method 2:
Not in email body, configure email script with name as "test_script".
(Never hardcode the instance name, use glide.servlet.uri
var URL= '<a href="' + gs.getProperty('glide.servlet.uri') + '/now/'+ current.getTableName() + '/' + current.sys_id + '">' + current.number + '</a>';
template.print(URL+ "<br />");
and in notification body, call that email script like this:
${mail_script:test_script}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 10:20 AM
Hello Saini,
To create a hyperlink in a notification that takes the user to the record whose number is clicked, you can use the following format:
https://instance_name.service-now.com/nav_to.do?uri=table_name.do?sys_id={sys_id}
- Replace instance_name with the name of your ServiceNow instance
- Replace table_name with the name of the table that the record belongs to
- Replace {sys_id} with the sys_id of the record.
For Example:
https://myinstance.service-now.com/nav_to.do?uri=incident.do?sys_id=9c7d3f20dbd6f8c0dda11f7dca9619ed
This will create a hyperlink that, when clicked, will take the user directly to the incident record whose sys_id is "9c7d3f20dbd6f8c0dda11f7dca9619ed" in the incident table.
You can also use ${URI_REF} in the mail script to get the record link.
<a href="${URI_REF}">${number}</a>
This will create a hyperlink that, when clicked, will take the user directly to the record whose number is clicked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 10:42 AM - edited 01-27-2023 10:43 AM
Method 1:
In your case, text should be:
Order task Number: ${URI_REF}
Method 2:
Not in email body, configure email script with name as "test_script".
(Never hardcode the instance name, use glide.servlet.uri
var URL= '<a href="' + gs.getProperty('glide.servlet.uri') + '/now/'+ current.getTableName() + '/' + current.sys_id + '">' + current.number + '</a>';
template.print(URL+ "<br />");
and in notification body, call that email script like this:
${mail_script:test_script}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 12:21 PM
This is working fine for me.
Order task Number: ${URI_REF}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023 12:22 PM
{URI_REF} is working fine for me.