Instance URL via JavaScript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 08:52 AM
I usually only use this code to create links within comments or e-mail notifications:
var html = '<a href="/nav_to.do?uri=' + current.getTableName() + '.do?sys_id=' + current.sys_id + '" target="blank">' + current.number + '</a>';
Are there any script include functions that I can call to get the instance URL to create the FQDN?
For example, clicking this link via an e-mail while a user is not logged on will give a 404 error.
If the comment resides in a dev instance I would want the URL to be: https://instancedev.servicenow.com/[URL HERE]
If the comment resides in a production instance I would want the URL to be: https://instance.servicenow.com[URL HERE]
Is there any way to call the DNS or FQDN via javascript? At least with the FQDN, I can parse it and trim it to what I need...
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 11:08 AM
Welcome.
FYI: in our case the value is equivalent to the name/URL of our instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2014 05:22 PM
Wanted to let you know this code snippet solved a big problem for me today. MANY THANKS!
-Paul Porter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2017 01:02 AM
HI Daniel
how to use the logic in business rule to get link by clicking the incident number
now i am able to see the whole link but it looks complete link pasting here i need only incident number by clicking incident number i need to redirect to webpage this need to be done in business rule
can any one help on this??