When I try to access the Global Properties environment variables (Manage Jenkins > Configure System > Global Properties) I either get null or an error (details below)
To replicate issue:
- Browse to Manage Jenkins > Configure System
- under the "Global Properties" make sure "Environment variables" is checked
- under the "Global Properties" > "Environment variables" add a new variable
- name = TEST_VAR
- value = some value
- In left navigation add "New Item"
- my job was named "workflow-test"
- select "Workflow" job type
- under the "Workflow" heading
- Definition: "Groovy CPS DSL"
Build workflow job and go to Console output
from the output can see that the above script evaluates to: