-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.170
BlueOcean 1.14
I'm using BlueOcean with declarative Pipelines. In one of my pipeline there is a step which executes a Jenkins "script" in which there is a jenkins "input" using parameter type "ChoiceParameterDefinition". It reads the choices from a variable which contains multiple lines :
steps { script { def userInput = input( id: 'userInput', message: "mytest", parameters: [ [$class: 'ChoiceParameterDefinition', choices: "${VAR_1}", name: 'config'] ]) VAR_2 = "${userInput}" } }
When there are choices composed of the exact same string, the UI bugs. The user is prompted with a choice list but when he clicks on the first choice it selects the second one and vice versa.
I came accross this bug when I was doing some testings with the same string in each line of the variable. I'm not sure there is a real use case where you would like to have the choice between the "same" options but it should be easy to fix with at least an error saying that you can't have two choices which are the same for 'ChoiceParameterDefinition'.
Please find an attached screenshot where I clicked the first choice and it selected the second one.
I'm not sure what the problem is here, the example you have doesn't work on its own.
I got as far as
but thats missing VAR_1
Is this using declarative syntax? or the other one.
I tried reproducing it on ci.blueocean.io but couldn't (set var_1 to "a\nb\nc\n")
https://ci.blueocean.io/blue/organizations/jenkins/Gavin%20Folder%2FJENKINS-56977%20-%20multiline%20choice/activity