<p>It's probably easier to create two separate parameters.  E.g.:</p>
<ul>
<li><p>Run tests? (boolean parameter)</p>
</li>
<li><p>If running tests, select tests (multi-select choice parameter)</p>
</li>
</ul>
<p>Then you could code your job to skip all tests if the first parameter is false, otherwise it would run the selected tests.</p>
<p>If you want to get really fancy, you can use the <a href="https://plugins.jenkins.io/uno-choice/" rel="nofollow noreferrer">Active Choices plugin</a> to dynamically show the list of tests parameter only if the &quot;run tests&quot; parameter is also selected.</p>

CC BY-SA 4.0
2022-09-21T15:47:57.667Z
2022-09-21T15:47:57.667Z
jayhendren
<p>I have a jenkins job with multi select extended choice parameter. There are list of elements in a parameter. So, my requirement is I want to allow users to select multiple parameters excluding first element in a parameter. Means user should not able to select first element with other elements in a parameters. I am using jenkinsfile to create parameter.</p>
<p><a href="https://i.sstatic.net/fksAB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fksAB.png" alt="enter image description here" /></a></p>
<p>Like shown above, users should not able to select 'None' with any other element in a parameter. Does anyone know how to do this?</p>

<jenkins><jenkins-pipeline><groovy>
In jenkins how to restrict users to select first default element with other options in extended choice parameter
Jenkins-Learner
# In jenkins how to restrict users to select first default element with other options in extended choice parameter

(Asked by: username_0 on 2022-09-20)

I have a jenkins job with multi select extended choice parameter. There are list of elements in a parameter. So, my requirement is I want to allow users to select multiple parameters excluding first element in a parameter. Means user should not able to select first element with other elements in a parameters. I am using jenkinsfile to create parameter.

[![enter image description here](https://i.sstatic.net/fksAB.png)](https://i.sstatic.net/fksAB.png)

Like shown above, users should not able to select 'None' with any other element in a parameter. Does anyone know how to do this?

**Tags:** jenkins, jenkins-pipeline, groovy


---

## 1 answers

### Answer by username_1 on 2022-09-21. Score: 0

It's probably easier to create two separate parameters. E.g.:

* Run tests? (boolean parameter)
* If running tests, select tests (multi-select choice parameter)

Then you could code your job to skip all tests if the first parameter is false, otherwise it would run the selected tests.

If you want to get really fancy, you can use the [Active Choices plugin](https://plugins.jenkins.io/uno-choice/) to dynamically show the list of tests parameter only if the "run tests" parameter is also selected.


---

