email mail script to direct users to Portal/Instance depending if have role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-09-2022 03:59 AM
Hi
I'm attempting to put together a mail script for a request notification which directs the user either to the Service Portal if they have no role and if they have an itil role directs the user to my tickets
I've started putting together the following but not sure how to direct ITIL users to the My Tickets view i have created
var requestURL = gs.getProperty('glide.servlet.uri') + "nav_to.do?uri=sc_req_item.do?sys_id=" + current.sys_id;
var portalUrl = "https://" + instance + ".service-now.com/";
if (gs.hasRole('itil')) {
requestURL = '';
template.print(portalUrl);
} else {
template.print("<a href=\"" + portalUrl + "\">My Tickets</a>");
//template.print("<a style='color: #0000FF;' href='" + requestURL + "' title='My Portal'>My Portal</a>");
}
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-09-2022 04:14 AM
Hi what is MY tickets here? is this widget on Portal?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-09-2022 04:43 AM
HI
I have setup a view under the standard fulfiller view of the Self Service Application Navigator. This may not be the best way but is only for ITIL users who have access to ServiceNow, other users can view there tickets through the SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-09-2022 04:15 AM
My tickets is portal page ?
Then try this
var requestURL = gs.getProperty('glide.servlet.uri') + "nav_to.do?uri=sc_req_item.do?sys_id=" + current.sys_id;
var portalUrl = "https://" + instance + ".service-now.com/sp";
if (!gs.hasRole('itil')) {
requestURL = '';
template.print(portalUrl);
} else {
template.print("<a href=\"" + portalUrl + "\id=my_ticket">My Tickets</a>");
//template.print("<a style='color: #0000FF;' href='" + requestURL + "' title='My Portal'>My Portal</a>");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-09-2022 05:10 AM
In the request URL you can add
sysparm_view=my_tickets
gs.getProperty('glide.servlet.uri') + "nav_to.do?uri=sc_req_item.do?sys_id=" + current.sys_id+"&sysparm_view=my_tickets";