
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 07:21 AM
We use a reverse proxy with an internal URL as well as the standard external *.service-now.com URL. I would like the glide.servlet.uri (property used to generate permalinks) to be set to a dynamic value like this: javascript:location.href.substring(0, location.href.indexOf("?")); It doesn't work. Does anyone know of a way to force it to evaluate the javascript?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 07:26 AM
Hi Brian,
As far as I know, properties are meant to be static values (hence the reason they are cached for performance reasons.) The only way to make this dynamic is to script it where ever the property is used. While this may be possible in some places (e.g. notifications or business rules) it's not always accessible to the customer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 07:26 AM
Hi Brian,
As far as I know, properties are meant to be static values (hence the reason they are cached for performance reasons.) The only way to make this dynamic is to script it where ever the property is used. While this may be possible in some places (e.g. notifications or business rules) it's not always accessible to the customer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 07:50 AM
Herein lies the impending issue for ServiceNow. I will open an enhancement request about this... Reverse Proxies are currently not supported, except the Edge Encryption Proxy which is necessarily a reverse proxy. We intend to implement it soon. In knowledge articles, the UI Macro kb_article_footer uses the following code to build out the Permalink:
<script>
var urlpath = location.href.substring(0, location.href.indexOf("?")) + "?sysparm_article=$[URL:kb.number]";
gel("permalink").href = urlpath;
gel("permatext").innerHTML = urlpath;
</script>
This builds out a dynamic URL that matches the internal or external URL, based on which one the client browser is currently using. You can see the link when you hover the "Copy Permalink" text, but when you click, the URL is overridden by the script include KBViewModelSNC. It is very clear that ServiceNow discourages any modification to this script. This is the function's code:
getPermalink: function (number) {
return (gs.getProperty("glide.servlet.uri") + "kb_view.do?sysparm_article=" + number);
},
glide.servlet.uri may not exist. You may have to create it to override what is dropped into the clipboard, but... If you want to see something terrifying, create the system property and then delete it. This will cause huge portions of the site to render incorrectly. So, once you've created it, keep it.
We will hardcode the internal URL into glide.servlet.uri and hope for the best.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 07:54 AM
Hi Brian,
I concur with your idea to raise a HI ticket to get our developers thinking about this (if they aren't already.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 03:11 AM
Hi Brian,
We have exactly the same need as you and we think that Service Now should provide a solution about the concern of custom URL.
I've tried your solution, i.e. define a property 'glide.servlet.uri' and set it to our custom URL. But it doesn't work, the legacy url is used. Did you succeed with that ?
Regards
Jean-Luc