Class DynamicReferenceParameter

All Implemented Interfaces:
ExtensionPoint, Describable<ParameterDefinition>, Serializable, CascadableParameter<Map<Object,Object>>, ScriptableParameter<Map<Object,Object>>, UnoChoiceParameter

public class DynamicReferenceParameter extends AbstractCascadableParameter

Provides a dynamic reference parameter for users. This is a not so elegant solution, since we are using a ParameterDefinition extension point, but it actually doesn't provide any parameter value.

This kind of parameter is only for reference. An use case is when you have several job parameters, but your input values may vary depending on previous executions. You can get the previous executions by accessing from your Groovy code the jenkinsProject variable.

Its options are retrieved from the evaluation of a Groovy script.

Since:
0.1
Author:
Bruno P. Kinoshita
See Also:
  • Constructor Details

    • DynamicReferenceParameter

      @Deprecated public DynamicReferenceParameter(String name, String description, Script script, String choiceType, String referencedParameters, Boolean omitValueField)
      Deprecated.
      see JENKINS-32149
      Constructor called from Jelly with parameters.
      Parameters:
      name - name
      description - description
      script - script
      choiceType - choice type
      referencedParameters - referenced parameters
      omitValueField - used in the UI to decide whether to include a hidden empty <input name=value>. false by default.
    • DynamicReferenceParameter

      @DataBoundConstructor public DynamicReferenceParameter(String name, String description, String randomName, Script script, String choiceType, String referencedParameters, Boolean omitValueField)
      Constructor called from Jelly with parameters.
      Parameters:
      name - name
      description - description
      randomName - parameter random generated name (uuid)
      script - script
      choiceType - choice type
      referencedParameters - referenced parameters
      omitValueField - used in the UI to decide whether to include a hidden empty <input name=value>. false by default.
  • Method Details

    • getChoiceType

      public String getChoiceType()
      Description copied from class: AbstractUnoChoiceParameter

      Gets the choice type.

      This method can be called from Javascript

      Specified by:
      getChoiceType in class AbstractUnoChoiceParameter
      Returns:
      choice type
    • getOmitValueField

      public boolean getOmitValueField()
    • getChoicesAsStringForUI

      @JavaScriptMethod public String getChoicesAsStringForUI()