Interface OptionsManager

All Known Implementing Classes:
CachedOptionsManager, DefaultOptionsManager, MockOptionsManager

@PublicApi public interface OptionsManager
Manages option values for fields (eg. custom field select lists).
  • Method Details

    • getOptions

      Options getOptions(FieldConfig fieldConfig)
      Get options for this particular custom field type. As a custom field may have multiple types of options (e.g. cascading drop-downs), the type can be used to signify this
      Parameters:
      fieldConfig - For example, retrieved from CustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)
      Returns:
      An option Object of Options
    • setRootOptions

      void setRootOptions(FieldConfig fieldConfig, Options options)
    • removeCustomFieldOptions

      void removeCustomFieldOptions(CustomField customField)
    • removeCustomFieldConfigOptions

      void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
    • updateOptions

      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.
    • createOption

      Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
      Create a new option for the given custom field config.
      Parameters:
      fieldConfig - The custom field config to create the option for
      parentOptionId - The id of the parent option, or null if this is a root option
      sequence - The sequence of the option (position on the list)
      value - The value of the option
      Returns:
      The newly created option
    • createOptions

      @ExperimentalApi List<Option> createOptions(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options)
    • deleteOptionAndChildren

      void deleteOptionAndChildren(Option option)
    • findByOptionId

      Option findByOptionId(Long optionId)
    • getAllOptions

      List<Option> getAllOptions()
      Retreives all Option in the system.
      Returns:
      a list of all options in the system
    • enableOption

      void enableOption(Option option)
      Set an option to enabled.
      Parameters:
      option - The Option to enable.
    • disableOption

      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.
    • setValue

      void setValue(Option option, String value)
    • findByOptionValue

      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.
    • findByParentId

      List<Option> findByParentId(Long parentOptionId)
      Finds all options with the given parent option id. Returns an empty list if no options are found.
      Parameters:
      parentOptionId - the id of the parent option.
      Returns:
      the list of found options, empty if non found.
    • getOptions

      @Nonnull List<Option> getOptions(@Nonnull CustomField field, @Nonnull Collection<Long> projectIds, @Nonnull Collection<String> issueTypeIds)
      Returns all options in the context of given projects and issue types for the custom field.
      Parameters:
      field - a custom field whose options are requested
      projectIds - a collection of project ids
      issueTypeIds - a collection of issue types ids
      Returns:
      a list of options for the given custom field and context or an empty list if no options exist.
      See Also: