- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 12:33 PM
When a user receives an email notification that an incident has been assigned to their group, the link that takes you to the incident does not include the full ServiceNow navigation but only the incident window.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 01:48 PM
This is a link to an incident which preserves navigation ( note: I randomized the sys_id in this example)
This is a link to an incident which does not preserve navigation:
https://YOUR_INSTANCE_HERE.service-now.com/incident.do?sys_id=086893c70a0a3c7e0060fe80d534506f
Here's a quick guess as some code that might help:
*** Warning: untested code follows. Use at own risk ***
Replace
var link = current.getLink();
With
var link = "https://YOUR_INSTANCE_HERE.service-now.com/nav_to.do?uri=incident.do?sys_id=" + current.sys_id.toStr...
EDIT: Adding advice to allow this solution to adapt to the instance where it may run. Instead of hardcoding the instance name in the URL, you can obtain it from the system property "instance_name". There is a reference for how to do this at GlideSystem - ServiceNow Wiki
It basically would go like this, replace the initial statement with these: ( caveat: untested code follows )
var instance = gs.getProperty('instance_name');
var link = "https://" + instance + ".service-now.com/nav_to.do?uri=incident.do?sys_id=" + current.sys_id.toStrin...
NOTE: Email notifications should be included in update sets. If it's not there, maybe there's a problem with your "Application Scope". Out of the box notifications are probably in the global scope.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 06:34 AM
This is certainly a valid solution. So I can't really be critical about it. That said, here are some considerations:
1. If "current.getLink()" is changed to return different link text, your replace may fail.
2. Likewise, in the solution I posed, if the URL to present the navigational pane ever changes, my string concatenation could produce a URL that fails.
So there you have it. Either option will work for a while. Each is vulnerable to a future change to the system. Which change is more probable? I really can't say. But if you have an idea that one is more probably then the other, I would use that as a basis for selecting which option to use.