@PublicApi public interface

OptionsManager

com.atlassian.jira.issue.customfields.manager.OptionsManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Manages option values for fields (eg. custom field select lists).

Summary

Public Methods
Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
void deleteOptionAndChildren(Option option)
void disableOption(Option option)
Set an option to disabled.
void enableOption(Option option)
Set an option to enabled.
Option findByOptionId(Long optionId)
List<Option> findByOptionValue(String value)
Finds all options with the given value.
List<Option> findByParentId(Long parentOptionId)
List<Option> getAllOptions()
Retreives all Option in the system.
Options getOptions(FieldConfig fieldConfig)
Get options for this particular custom field type.
void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
void removeCustomFieldOptions(CustomField customField)
void setRootOptions(FieldConfig fieldConfig, Options options)
void setValue(Option option, String value)
void updateOptions(Collection<Option> options)
Update a set of options.

Public Methods

public Option createOption (FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)

public void deleteOptionAndChildren (Option option)

public void disableOption (Option option)

Set an option to disabled. A disabled option will is not available to be assigned to this associated custom field, It remains valid historically and for searching with.

Parameters
option The option to be disabled.

public void enableOption (Option option)

Set an option to enabled.

Parameters
option The Option to enable.

public Option findByOptionId (Long optionId)

public List<Option> findByOptionValue (String value)

Finds all options with the given value. Returns and empty list if no options are found.

Parameters
value the value of the options to find (case insensitive). Must not be null.
Returns
  • the list of found options, empty if non found.

public List<Option> findByParentId (Long parentOptionId)

public List<Option> getAllOptions ()

Retreives all Option in the system.

Returns
  • a list of all options in the system

public Options getOptions (FieldConfig fieldConfig)

Get options for this particular custom field type. As a custom field may have multiple types of options (eg cascading drop downs), the type can be used to signify this

Parameters
fieldConfig For example, retrieved from getRelevantConfig(com.atlassian.jira.issue.Issue)
Returns
  • An option Object of Options

public void removeCustomFieldConfigOptions (FieldConfig fieldConfig)

public void removeCustomFieldOptions (CustomField customField)

public void setRootOptions (FieldConfig fieldConfig, Options options)

public void setValue (Option option, String value)

public void updateOptions (Collection<Option> options)

Update a set of options. After doing this, any existing Options objects may be stale, and should be re-fetched with getOptions(com.atlassian.jira.issue.fields.config.FieldConfig).

Parameters
options Usually an Options implementation.