Jenkins – Accessing Variables Specified for Jenkins Groovy Plugin Script

groovyJenkinsjenkins-plugins

When writing a script that is run by Jenkins Groovy Plugin as a build step (Execute System Groovy Script) one can specify 'variable bindings'. The helpline says: Define varibale bingings (in the properties file format). Spefified variables can be addressed from the script. [sic] How do I access those variables from the script? They are not set as environment variables for the build, neither are they present among System properties.

Best Answer

this.getBinding().getVariables()

or simply binding.variables