Class DefaultIssueTypeManager

java.lang.Object
com.atlassian.jira.config.AbstractIssueConstantsManager<IssueType>
com.atlassian.jira.config.DefaultIssueTypeManager
All Implemented Interfaces:
IssueTypeManager, Startable

public class DefaultIssueTypeManager extends AbstractIssueConstantsManager<IssueType> implements IssueTypeManager, Startable
Since:
v5.0
  • Constructor Details

  • Method Details

    • start

      public void start()
      Description copied from interface: Startable
      This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
      Specified by:
      start in interface Startable
    • createIssueType

      public IssueType createIssueType(String name, String description, String iconUrl)
      Description copied from interface: IssueTypeManager
      Create a new (non-subtask) issue type. The new issue type will be added to the default issue type scheme.
      Specified by:
      createIssueType in interface IssueTypeManager
      Parameters:
      name - name of the issue type. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - description for the issue type.
      iconUrl - icon URL for the issue type. Cannot be null or blank.
      Returns:
      the new IssueType
    • createIssueType

      public IssueType createIssueType(String name, String description, @Nullable Long avatarId)
      Description copied from interface: IssueTypeManager
      Create a new (non-subtask) issue type. The new issue type will be added to the default issue type scheme.

      After successful creation of the new issue type, this method publishes an instance of IssueTypeCreatedEvent.

      Specified by:
      createIssueType in interface IssueTypeManager
      Parameters:
      name - name of the issue type. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - description for the issue type.
      avatarId - avatarId for the issue type. Cannot by null.
      Returns:
      the new IssueType
    • createSubTaskIssueType

      public IssueType createSubTaskIssueType(String name, String description, String iconUrl)
      Description copied from interface: IssueTypeManager
      Create a new subtask issue type. The new issue type will be added to the default issue type scheme.
      Specified by:
      createSubTaskIssueType in interface IssueTypeManager
      Parameters:
      name - name of the issue type. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - description for the issue type.
      iconUrl - icon URL for the issue type. Cannot be null or blank.
      Returns:
      the new IssueType
    • createSubTaskIssueType

      public IssueType createSubTaskIssueType(String name, String description, @Nullable Long avatarId)
      Description copied from interface: IssueTypeManager
      Create a new subtask issue type. The new issue type will be added to the default issue type scheme.
      Specified by:
      createSubTaskIssueType in interface IssueTypeManager
      Parameters:
      name - name of the issue type. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - description for the issue type.
      avatarId - avatarId for the issue type. Cannot by null.
      Returns:
      the new IssueType
    • clearCaches

      protected void clearCaches()
      Overrides:
      clearCaches in class AbstractIssueConstantsManager<IssueType>
    • editIssueType

      public void editIssueType(IssueType issueType, String name, String description, String iconUrl)
      Description copied from interface: IssueTypeManager
      Edits an existing issue type.
      Specified by:
      editIssueType in interface IssueTypeManager
      Parameters:
      issueType - existing issue type
      name - new name. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - new description.
      iconUrl - icon URL for the issue type. Cannot be null or blank.
    • updateIssueType

      public void updateIssueType(IssueType issueType, String name, String description, Long avatarId)
      Description copied from interface: IssueTypeManager
      Edits an existing issue type. After successful update of an issue type, this method publishes an instance of IssueTypeUpdatedEvent.
      Specified by:
      updateIssueType in interface IssueTypeManager
      Parameters:
      issueType - existing issue type
      name - new name. Cannot be null or blank. Must be unique across issue types and subtask issue types.
      description - new description.
      avatarId - avatar id the issue type. Cannot be null or blank.
    • getIssueTypes

      public Collection<IssueType> getIssueTypes()
      Description copied from interface: IssueTypeManager
      Returns all issue types regular and subtask issue types.
      Specified by:
      getIssueTypes in interface IssueTypeManager
      Returns:
      a collection of IssueTypes
    • removeIssueType

      public void removeIssueType(String id, String newIssueTypeId)
      Description copied from interface: IssueTypeManager
      Removes an issue type. All issues which use this issue type will be migrated to a different issue type which is specified in the second argument. After successful removal of an issue type, this method publishes an instance of IssueTypeDeletedEvent.
      Specified by:
      removeIssueType in interface IssueTypeManager
      Parameters:
      id - id of the issue type to remove
      newIssueTypeId - the id of the new issue type for all issues which are of the issue type which we are about to remove. Can be null.
    • getIssueType

      public IssueType getIssueType(String id)
      Description copied from interface: IssueTypeManager
      Returns the IssueType for the specified id.
      Specified by:
      getIssueType in interface IssueTypeManager
      Parameters:
      id - issue type id.
      Returns:
      an IssueType
    • getAvailableIssueTypes

      public Collection<IssueType> getAvailableIssueTypes(IssueType issueType)
      Description copied from interface: IssueTypeManager
      Returns a collection of suitable alternative IssueTypes to which issues with the supplied issue type can be moved to. The suitable alternative IssueTypes will have to use the same workflow, the same field configuration and the same screen scheme.
      Specified by:
      getAvailableIssueTypes in interface IssueTypeManager
      Parameters:
      issueType -
      Returns:
      a collection of IssueTypes
    • hasAssociatedIssues

      public boolean hasAssociatedIssues(IssueType issueType)
      Description copied from interface: IssueTypeManager
      Checks if there are any issues associated with this issue type.
      Specified by:
      hasAssociatedIssues in interface IssueTypeManager
      Parameters:
      issueType - for which issues are searched.
      Returns:
      true if the issue type has any associated issues.
    • getIssueConstantField

      protected String getIssueConstantField()
      Specified by:
      getIssueConstantField in class AbstractIssueConstantsManager<IssueType>
    • getAllValues

      protected List<IssueType> getAllValues()
      Specified by:
      getAllValues in class AbstractIssueConstantsManager<IssueType>