Package com.atlassian.jira.project.type
Interface ProjectTypeManager
- All Known Implementing Classes:
ProjectTypeManagerImpl
@PublicApi
public interface ProjectTypeManager
Manager to access information about the different project types defined on the JIRA instance.
- Since:
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.fugue.Option<ProjectType> Returns the project type with the given key, if it is accessible.io.atlassian.fugue.Option<ProjectType> Returns the project type with the given key, if it is accessible for the given user.Returns all the accessible project types defined on the JIRA instance sorted by weight.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.io.atlassian.fugue.Option<com.atlassian.application.api.Application> Returns the application that provides the given project type.io.atlassian.fugue.Option<ProjectType> getByKey(ProjectTypeKey key) Returns the project type with the given key, if it is present on the JIRA instance.Returns a project type with information to be displayed to users when a specific project type is not accessible.booleanisProjectTypeInstalledButInaccessible(ProjectTypeKey projectTypeKey) Returns whether the project type with the given key is installed but inaccessible.booleanisProjectTypeUninstalled(ProjectTypeKey projectTypeKey) Returns whether the project type with the given key is uninstalled.
-
Method Details
-
getAllProjectTypes
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.
-
getAllAccessibleProjectTypes
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.
-
getByKey
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
-
getAccessibleProjectType
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
-
getAccessibleProjectType
io.atlassian.fugue.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 userkey- The project type key- Returns:
- The project type of the given key
-
getInaccessibleProjectType
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;
-
getApplicationWithType
io.atlassian.fugue.Option<com.atlassian.application.api.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.
-
isProjectTypeUninstalled
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.
-
isProjectTypeInstalledButInaccessible
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.
-