- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 03:13 AM
Hi,
I've currently got a notification script set up to paste an ESS link if the user is not an ITIL user, but to do the opposite if they are. I was just wondering if there was any way I could change the script so that it's got the URL variable of the site, so that I do not have to make seperate changes for both dev and live versions of the instance? I mean in the way like ${URI_REF} does.
Here is my code so far, it works but if I was to clone live over my dev environment the links would all be broken as they'd point to the live URL:
if (gs.getUser().getUserByID(current.getValue('caller_id')).hasRole('itil') == true){
return '${URI_REF}';
} else if (gs.getUser().getUserByID(current.getValue('caller_id')).hasRole('itil') != true){
return '<a href="https://MyCompanyDev.service-now.com/ESS?sys_id=${sys_id}&view=sp&id=ticket&table=incident ">${number}</a>';
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 03:18 AM
Hi try below
return "<a href=" + gs.getProperty('glide.servlet.uri') + "/ESS?>LINK</a>";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 02:10 PM
In my notification (not the template) I used this and it works as expected for ${glide.servlet.uri}:
<tr>
<td style="padding-left: 5px; padding-bottom: 10px;" colspan="3"><strong>Requested Item:</strong> <a href=" ${glide.servlet.uri}/nav_to.do?uri=sc_req_item.do?sys_id=${request_item.sys_id}">${request_item}</a> - ${request_item.cat_item}</td>
</tr>