-
-
Save jgraglia/44a7443847cff6f0d87387a46c7bb82f to your computer and use it in GitHub Desktop.
// YOU HAVE TO : | |
// 1. install the Extended Choice Parameter Plugin : https://wiki.jenkins.io/display/JENKINS/Extended+Choice+Parameter+plugin | |
// 2. Allow the instanciation of ExtendedChoiceParameterDefinition in you script approval admin page https://myjenkins/scriptApproval/ | |
List params = [] | |
List props = [] | |
// https://github.com/jenkinsci/extended-choice-parameter-plugin/blob/master/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java#L427 | |
// https://issues.jenkins-ci.org/browse/JENKINS-34617 | |
com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition test = new com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition( | |
"name", | |
"PT_CHECKBOX", | |
"VALUE, A, B", | |
null,//project name | |
null, | |
null, | |
null, | |
null,// bindings | |
null, | |
null, // propertykey | |
"VALUE, B", //default value | |
null, | |
null, | |
null, | |
null, //default bindings | |
null, | |
null, | |
null, //descriptionPropertyValue | |
null, | |
null, | |
null, | |
null, | |
null, | |
null, | |
null,// javascript file | |
null, // javascript | |
false, // save json param to file | |
false, // quote | |
2, // visible item count | |
"DESC", | |
"," | |
) | |
params << test | |
props << parameters(params) | |
properties(props) |
How do you use it as part of the declarative pipeline?
same question , How do you use it as part of the declarative pipeline?
Thanks! Works like a charm :-).
Man, thanks a lot! It did the trick! =D
Thanks for sharing that! Do you have an example with multi-level json payload?
Same, How do you use it as part of the declarative pipeline?
Bump for Declarative Pipeline
Bump for Declarative Pipeline
Thanks! this works great !
Bump for declarative pipeline :)
Looks great, does it support custom Groovy code ?
Thanks !
How about Declarative Pipelines? Still a blocker...
Bump for Declarative Pipeline
I have a patch which allows extendedChoice()
to be used in the parameters
block of a declarative pipeline:
@rodrigc i tried a lot and still struggling , could you please explain me bit more on this how did you do it.
same here....unable to use it in declarative pipeline
You can use is declarative pipeline now - jenkinsci/extended-choice-parameter-plugin#25
Thanks!