Skip to content

Latest commit

 

History

History
178 lines (112 loc) · 6.01 KB

File metadata and controls

178 lines (112 loc) · 6.01 KB

Extended Choice Parameter Plugin

Build
Contributors
Jenkins Plugin Installs
Plugin

END OF LIFE

Given the age of this plugin and the number of security issues with the code base, no further development is expected. There are many excellent alternatives that may suit your purpose.

ALTERNATIVES

There are other parameter plugins to use for user inputs.

File Inputs and Outputs

Any file I/O will be removed in a future version. Use another step to read or write files:

Groovy Scripting

Any Groovy Scripting will be removed in a future version. Use pipeline or another plugin to execute groovy:

Introduction

The extended-choice-parameter-plugin creates various types of choice fields for use with the Input Step plugin.

This is accomplished using json-editor, which generates an HTML form from a JSON Schema. The json editor requires two inputs: the html id of the section holding the form and options which drive the form creation.

Help Wanted

Additional documentation is desired. Please create pull requests with better documentation of the params. Thanks!

Params

name

The name of the parameter.

type

The type of parameter

  • Single Select: user chooses a single selection from a drop-down menu, populated by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Multi Select: a user can choose multiple selections from a multi-line box, populated by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Check Boxes: user can check off zero or more check boxes, labeled by either explicit values (see Value field below) or a property file (see Property File and Property Key fields below)
  • Multi-Level Single Select: user chooses a selection from a drop-down, and then a another drop down appears with selections that depend on the first value, and upon second selection a third drop down may appear depending on the first two selections, and so on.
  • Multi-Level Multi Select: same as single select, but after all levels are chosen, a button appears to "Select another..." and an additional multi-level selection is presented.

value

Comma separated list of values for the single select or multi-select box. This field can be left blank if the comma separated values need to be picked up from a properties file (set via 'Property File' and 'Property Key').

propertyFile

The properties file is a collection of key,value pairs of the form key=value1,value2,...

propertyKey

The property of the property file to use.

For example, if the property file was the following:

prop1=a,b,c,d,e
prop2=1,2,3,4

Then you could specify the property as either prop1 or prop2.

defaultValue

Initial selection of the single-select or mult-select box.

In case of the multi-select box, default value can be a comma separated string.

defaultPropertyFile

Absolute path (specified without using environment variables).

multiSelectDelimiter

Inserts this value between selections when the parameter is a multi-select.

The default when empty is ','

projectName

If specified, this adds a currentProject entry to the groovy script context. The entry's value is set to the specified Jenkins project.

quoteValue

If true, the value or selected values will be formatted with quotes.

visibleItemCount

If specified, this will limit the amount of options displayed by creating a scrolldown list with the only the specified amount visible at once.

groovyScript

A groovy script used to generate the list of values.

groovyScriptFile

A file containing a groovy script used to generate the list of values.

defaultGroovyScript

A groovy script used to generate the list of values used in the initial selection of the single-select or mult-select box.

defaultGroovyScriptFile

A file containing a groovy script used to generate the list of values used in the initial selection of the single-select or mult-select box.

bindings

groovyClasspath

defaultBindings

defaultGroovyClasspath

defaultPropertyKey

descriptionPropertyValue

descriptionPropertyFile

descriptionGroovyScript

descriptionGroovyScriptFile

descriptionBindings

descriptionGroovyClasspath

descriptionPropertyKey

javascriptFile

javascript

saveJSONParameterToFile

More

For info on how to use groovy script feature see this link

Contributing

Refer to contribution guidelines

LICENSE

Licensed under MIT, see LICENSE