Class DropdownDefinition

java.lang.Object
hudson.model.AbstractDescribableImpl<DropdownDefinition>
io.jenkins.plugins.dynamic_view_filter.DropdownDefinition
All Implemented Interfaces:
Describable<DropdownDefinition>

public class DropdownDefinition extends AbstractDescribableImpl<DropdownDefinition>
Defines a single dropdown filter for DropdownFilterView.

Two source types are supported:

  • jobNameRegex — a regex with a capture group applied to the job's full name. The first capture group's match becomes the dropdown value. Example: projects/([^/]+)/.* captures the project name.
  • buildParameter — collects distinct values of a named build parameter from actual build runs.
  • Constructor Details

    • DropdownDefinition

      @DataBoundConstructor public DropdownDefinition(String label, String sourceType, String jobNamePattern, String parameterName)
  • Method Details

    • getLabel

      public String getLabel()
    • getSourceType

      public String getSourceType()
    • getJobNamePattern

      public String getJobNamePattern()
    • getParameterName

      public String getParameterName()
    • extractAllValues

      public List<String> extractAllValues(TopLevelItem item)
      Extract all possible values for this dropdown from the given item. For jobNameRegex: applies the regex to the job's full name and extracts the first capture group. For buildParameter: scans actual build runs to collect distinct values.
    • matches

      public boolean matches(TopLevelItem item, String selected)
      Check if an item matches the given dropdown selection.