Class JsonParameterReferenceDefinition

All Implemented Interfaces:
ExtensionPoint, Describable<ParameterDefinition>, Serializable

public class JsonParameterReferenceDefinition extends AbstractJsonParameterDefinition
A JSON-backed Jenkins parameter that can reference the value of another parameter.

This behaves like JsonParameterDefinition, but its JSONPath query may contain a placeholder in the form ${REF}. The placeholder is dynamically substituted with the current value of the referenced parameter (as configured in getRef()).

Example


 Query: $[?(@.user == "${USERS}")].email
 Ref:   USERS
 
→ The dropdown options will filter e.g. by the currently selected "USERS" parameter.

AJAX requests from the build form call JsonParameterReferenceDefinition.DescriptorImpl.doLoadOptions(Job, String, String) to resolve the reference and load the appropriate dropdown options.

Author:
Caner
See Also:
  • Constructor Details

    • JsonParameterReferenceDefinition

      @DataBoundConstructor public JsonParameterReferenceDefinition(String name, String defaultValue, JsonSource source, String query, String ref)
      Data-bound constructor called by Jenkins when binding UI input.
      Parameters:
      name - The name of the parameter
      defaultValue - The default value used when none is provided
      source - The JSON source definition
      query - JSONPath query used to extract dropdown values
      ref - Reference to another parameter to get the value from
  • Method Details

    • getRef

      public String getRef()