Adding external link to Module

dhananjay_m
Kilo Contributor

I have case where in the Module on left hand navigation needs to be pointing to external links(out of Service now) which will be dynamic based on different environments such as dev, uat ,prod. So in case of dev the module link should point to http://www.xyz.com in case of uat it should point to http://www.abc.com and similarly for prod. I tried with URL (from arguments) but this typically doesn't solve my problem as I cannot associate a javascript function call in it. Script (from argument) also doesn't work in this case as it renders a script as a script call instead of evaluating the function. Ideal scenario would be if I can associate a function within the arguments where I can decide which link to render based on current service now instance.

Any one has come across such scenario?

Thanks,
Dhananjay

10 REPLIES 10

chi-kwong
Giga Contributor

I have done this, you can use "native" javascript:

javascript: window.open("http://www" + ( ( window.location.href.indexOf('prod') > -1 ) ? "" : "dev" ) + ".mysite.com");

if the browser you are coming from has "prod" in the url you will be directed to http"//www.mysite.com" otherwise it will be "http://wwwdev.mysite.com