I have a script pipeline that should work with and without parameters. Therefore, I have to check if the parameter is available.
I tried if(getBinding().hasVariable("myparameter")) , but this if(getBinding().hasVariable("myparameter")) exception
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.Binding getVariables
Is there any other way to check if a job is set?
source share