Skip to content

Instantly share code, notes, and snippets.

@ktor
Created June 10, 2020 17:52
Show Gist options
  • Select an option

  • Save ktor/f69e0718eda61a2e99516199f605bc33 to your computer and use it in GitHub Desktop.

Select an option

Save ktor/f69e0718eda61a2e99516199f605bc33 to your computer and use it in GitHub Desktop.
Access global jenkins properties from jenkins https://plugins.jenkins.io/extensible-choice-parameter/ groovy script
// source: https://stackoverflow.com/a/41160217/1180235
import jenkins.model.*
nodes = Jenkins.instance.globalNodeProperties
nodes.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class)
envVars = nodes[0].envVars
envVars['MY_GLOBAL_PROPERTY']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment