ricardo-larosa
6/13/2017 - 12:17 PM

Get Environment Variables

Get Environment Variables

instance = Jenkins.instance
envVarsNodeList = instance.globalNodeProperties.getAll(EnvironmentVariablesNodeProperty.class).get(0).getEnvVars()

if ( envVarsNodeList == null || envVarsNodeList.size() == 0 ) {
  //Handle this case
 
} else {
  
  myvar = envVarsNodeList['myvar']
}