Package com.atlassian.jira.jql.util
Class JqlSelectOptionsUtil
java.lang.Object
com.atlassian.jira.jql.util.JqlSelectOptionsUtil
Contains utility methods for processing select option clauses
- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionJqlSelectOptionsUtil
(OptionsManager optionsManager, FieldConfigSchemeManager fieldConfigSchemeManager, FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil) -
Method Summary
Modifier and TypeMethodDescriptiongetOptionById
(Long optionId) getOptions
(CustomField customField, QueryContext queryContext, QueryLiteral literal, boolean checkOptionIds) Returns the options that are represented by theQueryLiteral
that are visible in theQueryContext
for a particularCustomField
.getOptions
(CustomField customField, QueryLiteral literal, boolean checkOptionIds) Returns all the options possible represented by theQueryLiteral
for a particularCustomField
.getOptions
(CustomField customField, ApplicationUser user, QueryLiteral literal, boolean checkOptionIds) Returns the options that are represented by theQueryLiteral
that are visible to theUser
on theCustomField
.getOptionsForScheme
(FieldConfigScheme fieldConfigScheme) Retreives all the options for theFieldConfigScheme
.
-
Constructor Details
-
JqlSelectOptionsUtil
public JqlSelectOptionsUtil(OptionsManager optionsManager, FieldConfigSchemeManager fieldConfigSchemeManager, FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil)
-
-
Method Details
-
getOptions
public List<Option> getOptions(CustomField customField, QueryContext queryContext, QueryLiteral literal, boolean checkOptionIds) Returns the options that are represented by theQueryLiteral
that are visible in theQueryContext
for a particularCustomField
.- Parameters:
customField
- the customField to retreive options fromqueryContext
- the context to check if theOption
s are visible inliteral
- the literal to search forOption
s forcheckOptionIds
- 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 theQueryLiteral
that are visible to theUser
on theCustomField
.- Parameters:
customField
- the customField to retreive options fromuser
- the User to check if the option is visible toliteral
- the literal to search forOption
s forcheckOptionIds
- 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
- 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 theQueryLiteral
for a particularCustomField
.- Parameters:
customField
- the customField to retreive options fromliteral
- the literal to find options forcheckOptionIds
- 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
Retreives all the options for theFieldConfigScheme
.- Parameters:
fieldConfigScheme
- the config scheme to retrieve the options from.- Returns:
- the options for the
FieldConfigScheme
in a mutableList
; never null.
-