- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2016 05:54 PM
Hi all,
We would like to have emails going to the end users contain the portal link to their request / incident. I am using email notifications.
The actual link that we have is the following:
Incident:
http://<instance>.service-now.com/sp?id=ticket&table=incident&sys_id=22b899754f112240f5333d501310c786
Request:
http://<instance>.service-now.com/sp?id=sc_request&table=sc_request&sys_id=9350c9f14fddee00f5333d501310c715
I have been doing some research, and found a lot pointing towards this wiki entry: Scripting for Email Notifications - ServiceNow Wiki
That entry has helped my understanding, however it is old and is referring to the ESS page.
With the code that it suggests, it seems to always add incident.do?sysparm_document_key=incident in the code.
For example:
${CMS_URI+sp?id=ticket&table=incident}
https://<instance>.service-now.com/sp?id=ticket&table=incident.do?sysparm_document_key=incident,619dac624f09ea00f5333d501310c769
I know that I am missing something, hopefully someone out there can easily identify it.
Thanks in Advance!
Brendan
Solved! Go to Solution.
- 20,010 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 04:27 PM
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
09-21-2020 10:33 AM
Instead of ${number}, did you try ${task.request_item} ??
Brandon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 07:35 AM
Hi,
I want to get notifications in service portal impersonating as "assign to" user as in incident form,
when the priority of the incident changes. I tried your code but am not able to achieve it.
A small help would be very grateful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2017 12:50 PM
Thanks - just what I needed! 🙂
Regards Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2018 04:16 AM
Thanks for this Dylan!
Can I just ask if anyone has had issues with it breaking out of frameset if the user is not already logged in?
When I've tested this if the user is already logged in then it works fine, if not it redirects to login and them to $sp.do?id=ticket&table=incident&sys_id=b6e89b38db3b0700fc28f7671d96193f
rather than sp?id=ticket&table=incident&sys_id=b6e89b38db3b0700fc28f7671d96193f
Any ideas?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2019 12:27 PM
Thank you Dylan! I'm having the same problem. You worked this perfectly.
Any solutions?