Jenkins – Active Choice: CheckBox – Default values

 

When working with the Active Choice CheckBox parameter, you can select the default values by adding the ": selected" parameter

Pipeline:

properties([
  parameters([
    [$class: 'CascadeChoiceParameter', 
      choiceType: 'PT_CHECKBOX', 
      description: 'Select environment',
      filterLength: 1,
      filterable: false,
      name: 'Environment', 
      script: [
        $class: 'GroovyScript', 
        script: [
          classpath: [], 
          sandbox: false, 
          script: 
            'return[\'Development:selected\',\'Production:selected\']'
        ]
      ]
    ]
  ])
])

 

When assembling with parameters, two environments at once, "Development" and "Production" will be selected by default

Tagged: Tags

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Prashanth
Prashanth
10 months ago

Plz let me know how to list the property key values from gitlab to my Jenkins parameterized job using active choice reactive parameter