Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:
This plugin adds "Extensible Choice" as a build parameter.You can select how to retrieve choices, including the way to share choices among all jobs.
Note
|
For pipeline users: Editable Choice plugin is available and designed pipeline friendly. Please try that for pipelines. Extensible Choice Parameter plugin is designed for GUI-based jobs like freestyle projects, matrix projects and so on. It’s not planned to support pipeline syntaxes. |
This plugin provides a Extensible Choice parameter:
-
When building, the value can be selected with a dropdown like a built-in Choice parameter.
-
The choices can be provided in several ways:
-
Global Choice Parameter: defines choices in the Configure System page.
-
Choices can be shared by multiple jobs.
-
Updating the choices in the Configure System, every job can immediately refer the updated choices.
-
-
Textarea Choice Parameter: writes choices in a textarea, just like a built-in Choice parameter.
-
System Groovy Script Choice Parameter: runs a System Groovy script to determine the list of choices
-
File Choice Parameter: lists files in a directory.
-
-
Checking Editable checkbox allows you to specify any value, even one not in the choices.
-
Edited values can be added to the choice used next time automatically by checking "Add Edited Value".
-
-
You can add a new way to provide choices with Extension Points.
Some choice providers may cause security issues in your system:
Choice Provider | Security Issue | Note |
---|---|---|
File Choice Parameter |
Any users with project configuration privilege can list files in the OS with the privilege of the OS user Jenkins run with. |
Users can do that also with "Execute shell" or "Execute Windows Batch" build step. |
You can disable specific providers in system configuration page:
In the above screen, System Groovy Script Choice Parameter (unchecked one) is disabled.
-
You can select the way to define choices of the parameter.
-
A new way to provide choices can be added with Extension Points.
-
-
Selecting "Textarea Choice Parameter", you can define choices like the built-in Choice parameter.
-
"Global Choice Parameter" enables you to select a set of choices from the ones defined in System Configuration page.
-
"System Groovy Choice Parameter" generate choices with a Groovy script:
-
"File Choice Parameter" enables select a file in a specified directory:
-
You can specify its default value. This is useful with Global Choice Parameter to specify different default values in jobs:
-
Checking "Editable" enables you to input a value not in choices at build time:
A new way to provide choices can be added with extending
ChoiceListProvider
, overriding the following method:
abstract public List<String> getChoiceList()
To report a bug or request an enhancement to this plugin please create a ticket in JIRA (you need to login or to sign up for an account). Also have a look on How to report an issue