@PublicApi public interface

ProjectTypeManager

com.atlassian.jira.project.type.ProjectTypeManager
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

Manager to access information about the different project types defined on the JIRA instance.

Summary

Public Methods
Option<ProjectType> getAccessibleProjectType(ApplicationUser user, ProjectTypeKey key)
Returns the project type with the given key, if it is accessible for the given user.
Option<ProjectType> getAccessibleProjectType(ProjectTypeKey key)
Returns the project type with the given key, if it is accessible.
List<ProjectType> getAllAccessibleProjectTypes()
Returns all the accessible project types defined on the JIRA instance sorted by weight.
List<ProjectType> getAllProjectTypes()
Returns all the project types defined on the JIRA instance sorted by weight not taking into account whether the license to use those project types is valid or not.
Option<Application> getApplicationWithType(ProjectTypeKey key)
Returns the application that provides the given project type.
Option<ProjectType> getByKey(ProjectTypeKey key)
Returns the project type with the given key, if it is present on the JIRA instance.
ProjectType getInaccessibleProjectType()
Returns a project type with information to be displayed to users when a specific project type is not accessible.
boolean isProjectTypeInstalledButInaccessible(ProjectTypeKey projectTypeKey)
Returns whether the project type with the given key is installed but inaccessible.
boolean isProjectTypeUninstalled(ProjectTypeKey projectTypeKey)
Returns whether the project type with the given key is uninstalled.

Public Methods

public Option<ProjectType> getAccessibleProjectType (ApplicationUser user, ProjectTypeKey key)

Returns the project type with the given key, if it is accessible for the given user. A project type is considered accessible for an user if the application that defines it is present on the JIRA instance, that application has a license and the given user is licensed for that application.

Parameters
user The user
key The project type key
Returns
  • The project type of the given key

public Option<ProjectType> getAccessibleProjectType (ProjectTypeKey key)

Returns the project type with the given key, if it is accessible. A project type is considered accessible if the application that defines it is present on the JIRA instance and if there is a license for that application in the instance. Generally this method should be used when retrieving a project type for display in the application. The convention is to always display the project type if the application is licensed, even if the current user isn't licensed to access that application. Not showing the project type due to the user's individual license access should be the exception.

Parameters
key The project type key
Returns
  • The project type for the given key

public List<ProjectType> getAllAccessibleProjectTypes ()

Returns all the accessible project types defined on the JIRA instance sorted by weight. A project type is considered accessible if the application that defines it is present on the JIRA instance and if there is a license for that application on the instance. This method should be used when displaying available project types to admins (e.g. project create dialog, change project type dialog)

Returns
  • all the accessible project types defined on the JIRA instance sorted by weight.

public List<ProjectType> getAllProjectTypes ()

Returns all the project types defined on the JIRA instance sorted by weight not taking into account whether the license to use those project types is valid or not.

Returns
  • all the project types defined on the JIRA instance sorted by weight.

public Option<Application> getApplicationWithType (ProjectTypeKey key)

Returns the application that provides the given project type.

Parameters
key The project type key
Returns
  • The application associated to that project.

public Option<ProjectType> getByKey (ProjectTypeKey key)

Returns the project type with the given key, if it is present on the JIRA instance.

Parameters
key The project type key
Returns
  • The project type for the given key

public ProjectType getInaccessibleProjectType ()

Returns a project type with information to be displayed to users when a specific project type is not accessible.

A project type might be inaccessible if the user is not licensed under the application that defines the type or if the application that defines the type is not installed on the JIRA instance.

Returns
  • A project type encapsulating information for when a specific type is not accessible;

public boolean isProjectTypeInstalledButInaccessible (ProjectTypeKey projectTypeKey)

Returns whether the project type with the given key is installed but inaccessible.

Parameters
projectTypeKey The key of the project type for which we are performing the check.
Returns
  • Whether the project type is uninstalled but inaccessible.

public boolean isProjectTypeUninstalled (ProjectTypeKey projectTypeKey)

Returns whether the project type with the given key is uninstalled.

Parameters
projectTypeKey The key of the project type for which we are performing the check.
Returns
  • Whether the project type is uninstalled.