How to do a multiselect input in a pipeline

Issue

How to do a multiselect input in a pipeline

Environment

Resolution

If you need to add a multiselect input step inside a Pipeline, our recommendation is to use the Extended Choice Parameter plugin. Here you have an example of how to config inside a pipeline:


import com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition

node {
def multiSelect= new ExtendedChoiceParameterDefinition("name", 
            "PT_MULTI_SELECT", 
            "blue,green,yellow,blue", 
            "project name",
            "", 
            "",
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "blue,green,yellow,blue", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            "", 
            false,
            false, 
            3, 
            "multiselect", 
            ",") 

   def userInput = input  id: 'customID', message: 'Let\'s promote?', ok: 'Release!', parameters:  [multiSelect]


echo "Hello: "+ userInput
}

References

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.