How to check if build parameter is available in Jenkinsfile

后端 未结 5 560
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

    Newer versions make the parameters available through the params variable. If the parameter is not defined, it falls back to the configured default (see also here).

提交回复
热议问题