Not able to see 2nd level selection for extended choice parameter plugin in Jenkins

Not able to see 2nd level selection for extended choice parameter plugin in Jenkins,jenkins,jenkins-plugins,Jenkins,Jenkins Plugins,I am using the extended choice parameter plugin for my usecase where i need to select the testcase name and correponding machine names where it should be run. For learning purpose I tried creating a simple example of country and city selection as given in the plugin documentation. Here is my property file content Country City India bangalore India delhi All the words are separated by a tab. Here is how jenkins is configured When I click build with parameter, I see the option to select

I am using the extended choice parameter plugin for my usecase where i need to select the testcase name and correponding machine names where it should be run. For learning purpose I tried creating a simple example of country and city selection as given in the plugin documentation. Here is my property file content

Country City

India bangalore

India delhi

All the words are separated by a tab. Here is how jenkins is configured

Jenkins configuration

When I click build with parameter, I see the option to select a country, however once I select India, I dont see any dropdown appearing to select the city

After selecting country, no drop down appears for city

I am not sure if I have defined the value correct or not. My understanding is that the first row should define the lebels and than subsequent rows should define the values and all values should be separated by a tab. Not sure what is wrong here. Can anyone help ?


#1

The name of the extended choice parameter cannot contain space, it will be used as the javascript method, . i.e. change "testcase name" to testcase_name should resolve the issue.


#2

Alternatively, you can use ActiveChoicePlugin.

You can dynamically select City name based on the country. Just have to write few lines of groovy as shown in example

Active Choices Reactive Parameter Rendering (Example 02)

Edit 1 :-

If you have one to many mapping then you can use UnochoicePlugin. Once the plugin is installed you will have access to 3 more options in parameters section as

Uno-Choice Dynamic Choice Parameter
Uno-Choice Cascade Dynamic Choice Parameter
Uno-Choice Dynamic Reference Parameter

Select Uno-Choice Cascade Dynamic Choice Parameter, and add your fields for the city and pass Country as "Referenced parameters" to this filed.

Also Select Choice Type as "Check Box" in order to have one to many multiple mapping.For one to one you can either use Radio button or Select Type, which is equivalent to drop down menu.

Edit 2:-

1) Download the .hpi file from here.

2) Now go to Advance tab under Manage Plugins in Manage Jenkins option.

3) Upload this downloaded .hpi file and restart Jenkins.

4) Now you will have these options.

Edit 3:

Download from here Check this

Also next time please google the errors before posting here. We don't spoon feed here.

Hope it solves your purpose.


#3

Thanks. This helps but does not serve my purpose fully. For a testcase, multiple machines can be selected. So in above example, I need a capability where multiple cities can be selected for a selected country. So its one to many kind of a map. Not sure if ActiveChoicePlugin allow me to do that. From the example of plugin, it seems i can select only one city for a selected country. If also if there is a way to select multiple, how those value will be accessible from build. I want the country to selected city mapping to be used in the build.

#4

@ManojKSardana Please check Edit.

#5

Thanks. Unfortunately I am not able to see this plugin listed in available plugin for my jenkins server. Wondering if there is some dependency on the version if the jenkins or OS.