- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 06:00 PM
Hi Everyone,
When ServiceNow shoots an email to the customer after logging an incident, I am needing to include a link to the incident, but linking directly to the Service Portal view.
The email will be something like this...
I am currently linking them to our Service Portal page, and they have to find the ticket themselves.
If i use the URI_REF field in the email, it takes the user to the ServiceNow back end view, which we dont want users with no role to be able to see.
Is there any easy way to do this?
Any feedback or thoughts would be most appreciated.
Thanks,
Ed
Solved! Go to Solution.
- Labels:
-
Incident Management
- 11,264 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 06:26 PM
Hi Michael.Fry,
Thank you for this link to the page, it worked perfectly upon creating the new script. Were you able to change the link in the email from displaying "Link" to something else?
For anyone else looking, dylanhasselquist provides the script below.
In our own instance I included Service Portal links by using an email notification script, the contents of which looks like:
- (function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
- /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
- /* Optional GlideRecord */ event) {
- var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'sp?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">Link</a>';
- template.print(url);
- })(current, template, email, email_action, event);
I can then reference this in email notifications/templates by: ${mail_script:service_portal_link}
Note: The syntax highlighting looks a little off in the code snippet above, but you get the idea. I also replaced the name of our portal with "sp" to remain consistent with your example above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 06:09 PM
I used info from here to make my own: Portal hyperlinks via email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 06:26 PM
Hi Michael.Fry,
Thank you for this link to the page, it worked perfectly upon creating the new script. Were you able to change the link in the email from displaying "Link" to something else?
For anyone else looking, dylanhasselquist provides the script below.
In our own instance I included Service Portal links by using an email notification script, the contents of which looks like:
- (function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
- /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
- /* Optional GlideRecord */ event) {
- var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'sp?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">Link</a>';
- template.print(url);
- })(current, template, email, email_action, event);
I can then reference this in email notifications/templates by: ${mail_script:service_portal_link}
Note: The syntax highlighting looks a little off in the code snippet above, but you get the idea. I also replaced the name of our portal with "sp" to remain consistent with your example above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 06:28 PM