I am using jenkins Pipeline and trying to use parameters ( Inputs ) Like .e.g.
[$class: 'ChoiceParameterDefinition', choices: ['ADD','SHOW','DELETE','UPDATE','RESET'], description: 'Choose an Operation', name: ''].
How to set default value for ChoiceParameterDefinition ?
The Choice parameter doesn't have the option to use 'defaultValue' like f.e. StringParameter
See also https://jenkins.io/doc/book/pipeline/syntax/#parameters.
However, the first choice in your list will be picked as the default. See also the help section when configuring parameters.
Example if you want to have the default value to be empty:
[$class: 'ChoiceParameterDefinition', choices: ['','ADD','SHOW','DELETE','UPDATE','RESET'], description: 'Choose something', name: '']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With