- 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
‎03-31-2017 01:34 PM
its an email script:
(function runMailScript(current, template, email, email_action, event) {
var link = current.getLink();
if (email_action.name != "Incident Resolved") {
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print(gs.getMessage('You can view all the details of the incident by following the link below') + ':');
template.print('</font></p>');
}
else {
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print(gs.getMessage('If you feel the issue is not resolved, please click the following link and reopen your incident') + ':');
template.print('</font></p>');
}
template.print('<font face="helvetica">');
var backgroundColor = 'background-color: #278efc;';
var border = 'border: 1px solid #0368d4;';
var color = 'color: #ffffff;';
var fontSize = 'font-size: 16px;';
var fontFamily = 'font-family: Helvetica, Arial, sans-serif;';
var textDecoration = 'text-decoration: none; border-radius: 3px;';
var webKitBorder = '-webkit-border-radius: 3px;';
var mozBorder = '-moz-border-radius: 3px;';
var display = 'display: inline-block;';
var padding = 'padding: 5px;';
if (email_action.name == "Incident Survey") {
color = 'color: #343d47;';
backgroundColor = 'background-color: #e6e8ea;';
border = 'border: 1px solid #bdc0c4;';
}
template.print('<a href="' + link + '"');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
template.print('">');
template.print(gs.getMessage('Take me to the Incident'));
template.print('</a>');
template.print('</font>');
template.print('<br><br>');
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print('Thank you.');
template.print('</font></p>');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 01:50 PM
[EDIT] All joking aside, this is a prime candidate for an update to use the OOB tools.
I don't have time to dissect/make sense of all the code but you can to ALL of that without coding a single character.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 01:58 PM
the issue is that this was do-able before in like eureka i did this back then but now with helsinki the current version i am on they have changed it to to a link.do so let me try what steve said
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 02:20 PM
Rey, I apologize. I understand that my post while in jest, was in poor form.
I can't send you a PM to apologize because you're not following me, so I'll say it publicly.
In the future, you can save yourself a lot of headache by doing all of that in the normal notification engine--If you want to Reopen via email, you can use a mail template to spawn a new email, with a pre-set subject line (like email-based approvals), all the HTML can be done in the WYSIWYG editor, and you won't have to worry (as much) about stuff breaking on upgrades.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2017 01:32 PM
Find the offending email notification (like Steve mentions) and check the "Message HTML."
Add in the desired link type-- ${URI} or ${URI_REF} and you should be on your way.