How can I list the variables already available inside Jenkinsfile?
<p>I am trying to use some variables like repository name, branch names, build number,... from inside the <code>Jenkinsfile</code> but I am not able to find any documentation regarding this.</p>

<p>Is there a way to print them so I can see what's available? How?</p>

<p>I think it may be related to <a href="https://stackoverflow.com/questions/3069687/printing-out-variables-and-values-in-a-groovy-object">Printing out variables and values in a Groovy object</a></p>

<p>Update </p>

<pre><code>this.binding.variables.each {k,v -&gt; println "$k = $v"}
</code></pre>

<p>I tried to include the code above but now execution fails with </p>

<pre><code>org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use field groovy.lang.Binding variables
    at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectField(StaticWhitelist.java:177)
</code></pre>