logo

NJP

ServiceNow How to Get Instance URL Server Side in Scoped App

ServiceNow Blog · Jan 15, 2024 · article

ServiceNow How to Get Instance URL Server Side in Scoped App

when running the following in a fix script in scoped application

//--check for prod URL and cancel out

var env = gs.getProperty('glide.servlet.uri');

gs.info('rds_del_account_profile_identity::URL=' + env);

if (env.indexOf('prod.service-now.com') > -1) {

gs.info('rds_del_account_profile_identity::Not to be run on prod!!');

} else {

gs.info('rds_del_account_profile_identity::URL is OK');

}

you should be able to view the output of gs.info in the logs

View original source

http://www.cloudminus89.com/2024/01/servicenow-how-to-get-instance-url.html