Class JsonParameterReferenceDefinition
java.lang.Object
hudson.model.ParameterDefinition
com.github.cyanbaz.jenkins.plugins.jsonparameter.AbstractJsonParameterDefinition
com.github.cyanbaz.jenkins.plugins.jsonparameter.JsonParameterReferenceDefinition
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
Constructor Summary
ConstructorsConstructorDescriptionJsonParameterReferenceDefinition
(String name, String defaultValue, JsonSource source, String query, String ref) Data-bound constructor called by Jenkins when binding UI input. -
Method Summary
Methods inherited from class com.github.cyanbaz.jenkins.plugins.jsonparameter.AbstractJsonParameterDefinition
createValue, createValue, createValue, getDefaultParameterValue, getDefaultValue, getQuery, getSource
Methods inherited from class hudson.model.ParameterDefinition
all, copyWithDefaultValue, createValue, createValue, equals, getDescription, getDescriptor, getFormattedDescription, getName, getType, hashCode, isValid, setDescription
-
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 parameterdefaultValue
- The default value used when none is providedsource
- The JSON source definitionquery
- JSONPath query used to extract dropdown valuesref
- Reference to another parameter to get the value from
-
-
Method Details
-
getRef
-