Jenkins reactive choice parameter selection of values - jenkins

I have a choice parameter with values say:
A
B
BOTH
In above,
if i select "A", there should be one input box which should appear in the job parameter page to take value for A alone
if i select "B", there should be one input box which should appear in the job parameter page to take value for B alone
if i select "BOTH", there should be two input boxes which should appear in the job parameter page to take value for A & B values.
In the declarative script, i should print the values entered in the input boxes respectively. How to achieve this?

Similar but not the same question was answered here Parameterized Jenkins job with dependent parameter
Here is how you can parameterize your job:
Add an active choices parameter
Add an active choices reactive reference parameter
2.1. and choose Choice Type and Referenced parameters as follows
Implement pipeline script
Build with parameters and enter values into input fields
Here is the build output

Related

How can I create a checkbox with adjustable order in Jenkins? Or is it possible to customize prediction in String parameter in Jenkins?

Requirement:
I want to run multiple test cases in a single Jenkins job.
All those test cases are run one by one on the same Node.
User should be able to specify execution order of those test cases.
What I've tried
I tried checkbox. But order of checkbox candiates are fixed. Uses can select which test case
they want to run, but cannot adjust the order.
I tried String parameter. I put the candidate test case names in "description" and users can
copy and paste them into the input box, split by comma. But it seems to be crude. Is it
possible to add some, for example cutomized Groovy code to control the prediction. Whenever
a user types first letters of a test case after a comma, candidate test case names are
listed in a drop down list?
Or, does Jenkins provide a "select add" and "select remove" box pair? For example a left select box lists all candidate, and user select one and double click, or click "add" button, then the item is added to the right select box. And if user select an item in right box and click "remove" button, the item moves back to the right select box.
No matter which method is used, I just want to impelement such "select and adjust order" feature. How can I do it?

Specify multi-select parameters (Extended Choice Parameter plugin) in jenkins Build periodically with parameters

I am trying to schedule a job to be triggered daily at 8 pm.
Currently, my Build periodically with parameters field looks somewhat like this:
0 20 * * * % name=somename; type=sometype
Now, I need to add another parameter called categories which can have multiple values, i.e., it is of the type Multi Select (Extended Choice Parameter plugin).
Can someone help me out with how this can be done? Thanks in advance.

Active choice reactive parameter Hide name if no values are selected

Is there a Way of Hiding name before build with active choice reactive parameter? (in this case ID1, ID2 and ID3), I have configured a choice parameter and three active choice reactive parameters to enter some values in case that "values" option is selected. But I don´t want to show them in Jenkins UI if "no values" options is selected.
This is how I have it configured. (Adding just ID1 but the others 2 -ID2 and ID3- are the same)

Access Multi select values in Jenkins Extended Choice Parameters plugin

I’m using Extended Choice Parameters named Tasks in a job and the parameter type is Multi Select ( for example with these values: Start, Go, End), now how can I access the selected options ?
Meaning I want to create conditional step with Boolean condition so in case Start option was selected do X and another one in case Go option was selected do Y,
The question is what should be the Token of the Conditional step ?
(I prefer not using script in order to get selected values.)
Assuming you are using the Conditional BuildStep plugin, you should be able to use the "Strings Match" condition to setup your conditional steps. See the screenshots below for an example:
If multiple options can be selected, you can still setup the job as describe above. The only thing you need to change is the type of condition. Instead of using String match, use Regular expression match. This way you can run multiple build steps if you have a composite value.

Reading value of first dropdown from Extended Choice Parameter - Multi-Level single select

In Jenkins,
Using Extended Choice Parameter plugin, I am creating a Multi-Level single select
the "Name" of the parameter gives value of the second dropdown..
that is ${SITE_SELECTION} contains Message1
How could i get the value of the first dropdown?

Resources