- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 08:52 AM - edited ‎12-21-2022 08:55 AM
Hello experts,
Please I need your help, I created an email script to add it to an email notification, here it is:
*******************************************************************************************
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
template.print('<p><font size="2" color="#0f0f0f" face="helvetica">');
template.print(gs.getMessage('<br><i>Follow up your tickets in ServiceNow.</i>'));
template.print('</font></p>');
})(current, template, email, email_action, event);
****************************************************************************************
What I need is that if the user clicks on "ServiceNow" it takes the user to his opened tickets in the Service Portal,
how can that be done?
here is the SP Portal Page where I need users to be redirected:
https://company.service-now.com/sp?id=company_my_requests
Thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 10:45 AM
Update your script to
var link = '<div style="margin-top: 16px;"><a href="/sp?id=company_my_requests">ServiceNow</a>';
template.print(gs.getMessage('<p><font size="2" color="#0f0f0f" face="helvetica"><br><i>Follow up your tickets in '+link+'.</i></font></p>'));
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 09:11 AM
Hi @Jesus Nava ,
var link = '/sp?id=company_my_requests';
template.print('<div style="margin-top: 16px;"><a href="' + link + '"');
Regards,
Reshma
**Please mark my answer correct or helpful based on the impact**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 10:29 AM
thank you Reshmapatil, I did this:
*************************************************************************************************
var link = '/sp?id=company_my_requests';
template.print('<div style="margin-top: 16px;"><a href="' + link + '"');
template.print('<p><font size="2" color="#0f0f0f" face="helvetica">');
template.print(gs.getMessage('<br><i>Follow up your tickets in ServiceNow.</i>'));
template.print('</font></p>');
**************************************************************************************************
but it puts the link to the whole sentence, is tehre a way to put it just in the word ServiceNow?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 10:49 AM
Hi @Jesus Nava ,
Try this:
var instanceName = gs.getProperty('instance_name');
var link = '<a href="https://' + instanceName + '.service-now.com/nav_to.do?uri=rm_story.do%3Fsys_id=' + current.sys_id + '%26sysparm_stack=rm_story_list.do' + '">ServiceNow</a>';
template.print(link);
Regards,
Reshma
**Please mark my answer correct or helpful based on the impact**

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2022 10:45 AM
Update your script to
var link = '<div style="margin-top: 16px;"><a href="/sp?id=company_my_requests">ServiceNow</a>';
template.print(gs.getMessage('<p><font size="2" color="#0f0f0f" face="helvetica"><br><i>Follow up your tickets in '+link+'.</i></font></p>'));
Please mark this response as correct or helpful if it assisted you with your question.