In my Jenkins system configuration page, I have 3 variables defined, namely, sandbox_deployed, staging_deployed, and production_deployed. In my pipeline, I want to access one of these variables, based on a pipeline property, BUILD_ENV, defined in the job's configuration page. IOW, in my job's configuration page I have
BUILD_ENV=sandboxHow can I write pipeline code that does
println "$env.${env.BUILD_ENV}_deployed"If I write it like in the above println, I get
org.jenkinsci.plugins.wo...@336841dd.sandbox_deployedBut I really want this
println "env.sandbox_deployed"which prints out the correct value of the sandbox_deployed variable. What's the correct syntax?