Search code examples
jenkinsjenkins-pipelineextended-choice-parameter

Parameterized Jenkins Pipeline: Choices not showing up


I am trying to setup my pipeline as a Parameterized Pipeline using Single_select choice parameters.

My pipeline header looks as follows:

properties(
    [
        parameters([
            [
                $class: 'ChoiceParameter', 
                choiceType: 'PT_SINGLE_SELECT', 
                description: 'Select your testcase', 
                filterable: false, 
                name: 'testCases', 
                choices: ['HappyFlow', 'NewYork_HappyFlow']
            ]
        ]
    ), 
        pipelineTriggers([])
    ]
)

What happens when I am running my pipeline is the following:

Jenkins leaves the dropdown empty instead of giving me the options I specified in my pipeline properties

Jenkins leaves the dropdown empty instead of giving me the options I specified in my pipeline properties

How would I get the dropdown to be filled with the parameters from my pipeline properties?


Solution

  • This worked for me:

       parameters([choice(choices:['HappyFlow', 'NewYork_HappyFlow'], description: 'Select your testcase', name: 'testCases')          
            ])