Class JqlSelectOptionsUtil

java.lang.Object
com.atlassian.jira.jql.util.JqlSelectOptionsUtil

@InjectableComponent public class JqlSelectOptionsUtil extends Object
Contains utility methods for processing select option clauses
Since:
v4.0
  • Constructor Details

  • Method Details

    • getOptions

      public List<Option> getOptions(CustomField customField, QueryContext queryContext, QueryLiteral literal, boolean checkOptionIds)
      Returns the options that are represented by the QueryLiteral that are visible in the QueryContext for a particular CustomField.
      Parameters:
      customField - the customField to retreive options from
      queryContext - the context to check if the Options are visible in
      literal - the literal to search for Options for
      checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
      Returns:
      the list of found options, empty literals are ignored; never null.
    • getOptions

      public List<Option> getOptions(CustomField customField, ApplicationUser user, QueryLiteral literal, boolean checkOptionIds)
      Returns the options that are represented by the QueryLiteral that are visible to the User on the CustomField.
      Parameters:
      customField - the customField to retreive options from
      user - the User to check if the option is visible to
      literal - the literal to search for Options for
      checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
      Returns:
      the list of found options, empty literals are ignored; never null.
    • getOptionById

      public Option getOptionById(Long optionId)
      Parameters:
      optionId - the id of the option
      Returns:
      the Option found or null.
    • getOptions

      public List<Option> getOptions(CustomField customField, QueryLiteral literal, boolean checkOptionIds)
      Returns all the options possible represented by the QueryLiteral for a particular CustomField.
      Parameters:
      customField - the customField to retreive options from
      literal - the literal to find options for
      checkOptionIds - If true, the method tries to resolve long literals to option Ids before option values, and vice versa for string literals. If false, literals are only resolved to option values.
      Returns:
      the list of found options, it will contain only a single null if the literal is empty.
    • getOptionsForScheme

      public List<Option> getOptionsForScheme(FieldConfigScheme fieldConfigScheme)
      Retreives all the options for the FieldConfigScheme.
      Parameters:
      fieldConfigScheme - the config scheme to retrieve the options from.
      Returns:
      the options for the FieldConfigScheme in a mutable List; never null.