How to check if build parameter is available in Jenkinsfile

后端 未结 5 570
Happy的楠姐
Happy的楠姐 2021-02-07 15:16

I have a pipeline script that should work with and without parameters. So I have to check if the parameter is available.

I tried if(getBinding().hasVariable(\"mypa

5条回答
  •  难免孤独
    2021-02-07 15:34

    In the latest version of jenkins println(getBinding().hasVariable("myparameter")) is permitted and does not give an error any more.

提交回复
热议问题