Extended Choice Parameter

The Jenkins project announced unresolved security vulnerabilities affecting the current version of this plugin (why?):

Build
Contributors
Jenkins Plugin Installs
Plugin

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.

groovyScript

groovyScriptFile

bindings

groovyClasspath

defaultGroovyScript

defaultGroovyScriptFile

defaultBindings

defaultGroovyClasspath

defaultPropertyKey

descriptionPropertyValue

descriptionPropertyFile

descriptionGroovyScript

descriptionGroovyScriptFile

descriptionBindings

descriptionGroovyClasspath

descriptionPropertyKey

javascriptFile

javascript

saveJSONParameterToFile

quoteValue

visibleItemCount

More

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

Contributing

Refer to contribution guidelines

LICENSE

Licensed under MIT, see LICENSE