- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 12:38 AM
Hi All,
I have created notifications for incidents and add link in the message content at last called "Take me to the incident" for users who wanted to view the record directly from the email. So after clicking the link we are getting one error called "record not found" only while logged in. link has open on the other browser and we have to logged In to see the record after login we gets that error. Once login then we tried to click on link its working fine user will get the records. I am not sure why its happening while logged In. Please share the inputs if anyone knows the issue, so that I resolve it.
I have attached notification content and link which I have added.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 02:45 AM
Hello Shivani,
Please use the below code to set the Incident reocrd URL
Using only var link = "<a href='/incident.do?sys_id='"+current.sys_id+">Take me to the incident</a>"; will create an issue when user is not logged in ServiceNow and directly clicks the link from email.
var link = '<a href="https://' + gs.getProperty("instance_name") + '.service-now.com/incident.do?sys_id=' + current.getValue("sys_id") + '">Take me to the incident</a>';
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 06:11 AM
Please find attached snapshot of mail script changes:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 10:37 PM
Hello Shivani,
I don't see the code that I suggested in your screenshot. However you can use the below code and it will work:
var instanceName = gs.getProperty("instance_name");
var url = "https://" + gs.getProperty("instance_name") + ".service-now.com/incident.do?sys_id=" + current.getValue("sys_id");
var link = '<a href="' + url + '"> Take me to Incident </a>'
template.print(link);
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 10:57 PM
@mahendra
Thankyou so much for the resolution. I have added the same line in script and its work, thanks a lot