Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Dynamic parameters based on previously selected parameter value

Tags:

Here I am basically looking for a dependency parameter.

Let's say I have two dropdowns in the build parameter section. Based on the value selected from the first dropdown the possible default I want the values of the second dropdown to vary.

Is there any plugin or approach to handle this requirement effectively?

like image 229
Kishore Tamire Avatar asked Mar 27 '13 07:03

Kishore Tamire


People also ask

How do you pass a choice parameter in Jenkins?

Using build parameters, we can pass any data we want: git branch name, secret credentials, hostnames and ports, and so on. Any Jenkins job or pipeline can be parameterized. All we need to do is check the box on the General settings tab, “This project is parameterized”: Then we click the Add Parameter button.

How do I add extended choice parameters in Jenkins?

To install this plugin, you simply need to go to your jenkins instance and navigate to “/pluginManager/available”, and then search for “Extended Choice Parameter Plug-in” in the search box. Be careful! There is another plugin called “Extensible Choice Parameter Plug-in”.


2 Answers

Let's keep thing simple, Here is Step by Step process to achieve the required.
1.Install Active Choices Plugin in your Jenkins.
2.Add an ACTIVE CHOICE PARAMETER enter image description here

  1. Add an ACTIVE CHOICE REACTIVE PARAMETER. enter image description here

4.Click on apply and then on save.
Its done. !!!
Do comment if facing any problem with this.

like image 41
Hitsa Avatar answered Oct 03 '22 23:10

Hitsa


This is exactly what you are looking for: https://github.com/biouno/uno-choice-plugin/wiki/Uno-Choice-Cascade-Dynamic-Choice-Parameter

It seems to be a hidden gem, haven't found it in any of the similar questions so far.

like image 179
Torben Knerr Avatar answered Oct 03 '22 23:10

Torben Knerr