Search code examples
jenkinsjenkins-pluginsjenkins-pipeline

How to pass multi select value parameter in Jenkins file(Groovy)


E.g. Below code is used for single select value

        choice{
           choices: 'Box\nOneDrive\nSharePointOnline\nGmail\nGDrive\nGenericS3',
           defaultValue: 'box', 
           description:  'Connector to build',
           name: 'On_Cloud_Devices_To_Test'
         }

Solution

  • I would use booleanParam's. Then the user can tick all the required options.

    booleanParam(defaultValue: false, name: 'ALL', description: 'Process all'),
    booleanParam(defaultValue: false, name: 'OPTION_1', description: 'Process option 1'),
    booleanParam(defaultValue: false, name: 'OPTION_2', description: 'Process options 2'),