- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 05:40 AM - edited 07-27-2023 06:10 AM
Hi,
The below script is used to provide a link ' Take me to the item' along with the Notification which is sent to the caller.
this link redirects to the native UI page but I want to redirect to its RITM in the portal view.
how can I acheive this?
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var link = current.getLink();
template.print('<font face="Arial">');
var backgroundColor = 'background-color: #001440;';
var border = 'border: 1px solid #0368d4;';
var color = 'color: #ffffff;';
var fontSize = 'font-size: 10pt;';
var fontFamily = 'font-family: Lato, Arial, sans-serif;';
var textDecoration = 'text-decoration: none; border-radius: 3px;';
var webKitBorder = '-webkit-border-radius: 4px;';
var mozBorder = '-moz-border-radius: 4px;';
var display = 'display: inline-block;';
var padding = 'padding: 8px 20px;';
var margin = 'margin-bottom: 36px;';
template.print('<a href="' + link + '"');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding + margin);
template.print('">');
template.print(gs.getMessage('Take me to the RITM'));
template.print('</a>');
})(current, template, email, email_action, event);
thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:02 AM
you want to take user to the ticket page?
if yes then do this
var portalSuffix = 'sp'; // your portal suffix here
var link = portalSuffix + '?id=ticket&table=' + current.getTableName() + '&sys_id=' + current.sys_id;
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:02 AM
you want to take user to the ticket page?
if yes then do this
var portalSuffix = 'sp'; // your portal suffix here
var link = portalSuffix + '?id=ticket&table=' + current.getTableName() + '&sys_id=' + current.sys_id;
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:29 AM
Hi Ankur,
Thanks for the above.
Can you please take a look at my other question as well?
Alphabets missing in serial number when data is im... - ServiceNow Community
Thanks,
Rahul.