Details
-
Bug
-
Status: Resolved (View Workflow)
-
Minor
-
Resolution: Fixed
Description
Snippet generator generates an array:
input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'], description: '', name: 'env']]
ChoiceParameterDefinition requires a delimited string.
Workaround by modifying the snippet code by converting array to string with "\n" separator, e.g.:
input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: 'Red\nBlue\nGreen', description: '', name: 'env']]
Or just join the Array elements:
input id: 'Cc2a7d4d888ad098e3ca0ed7599d887d', message: 'Which environment?', ok: 'Submit', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Red', 'Blue', 'Green'].join('\n'), description: '', name: 'env']]
Attachments
Issue Links
- causes
-
JENKINS-63015 IllegalArgumentException for ChoiceParameter on bindJSON saving job configuration
-
- Closed
-
- depends on
-
JENKINS-27901 Standard form control for string collections
-
- Open
-
- is duplicated by
-
JENKINS-34590 Fail to generate correct input step with choice param syntax from snippet generator
-
- Resolved
-
-
JENKINS-38995 Choice parameters cannot be used inside of Multibranch Pipelines
-
- Resolved
-
-
JENKINS-33271 Snippet generator creates wrong input statement with ChoiceParameter
-
- Closed
-
- is related to
-
JENKINS-41180 "choice" parameter should take array for choices argument
-
- Closed
-
-
JENKINS-38913 DSL for choiceParam not working
-
- Open
-
-
JENKINS-26619 DescribableHelper does not handle GitSCMExtension
-
- Resolved
-
- relates to
-
JENKINS-53917 choice parameter no longer supports choices in pipeline
-
- Resolved
-
-
JENKINS-40358 Snippet editor: Invalid code for "choice" parameter/properties
-
- Resolved
-
-
JENKINS-63015 IllegalArgumentException for ChoiceParameter on bindJSON saving job configuration
-
- Closed
-
-
JENKINS-41180 "choice" parameter should take array for choices argument
-
- Closed
-
-
JENKINS-44892 Ability to override reflective metadata in DescribableModel
-
- Resolved
-
- links to
Hello all,
Since I upgraded Jenkins from jenkins:2.107.3-alpine to jenkins:2.121.1-alpine.
And I found the dsl with choices have parse error happen when Jenkins start up.
-------------------------------------------------------------------
pipelineJob( "$app" ) {
properties {
nextBuildNumber( "$num".toInteger() )
parameters {
parameterDefinitions {
choiceParam {
name( "$branchName" )
choices( "$branchChoices" )
description( '' )
}
}
}
}
}
-------------------------------------------------------------------
I tried to realize the choices syntax of DSL in http://192.168.99.100:30808/plugin/job-dsl/api-viewer/index.html.
I found the reference of choices expanded to recursive structure...
What's going on with this function now?
Thanks very much.
BR
Hong