Package com.atlassian.jira.config
Class DefaultIssueTypeService
java.lang.Object
com.atlassian.jira.config.DefaultIssueTypeService
- All Implemented Interfaces:
IssueTypeService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.config.IssueTypeService
IssueTypeService.CreateValidationResult, IssueTypeService.DeleteValidationResult, IssueTypeService.IssueTypeCreateInput, IssueTypeService.IssueTypeDeleteInput, IssueTypeService.IssueTypeResult, IssueTypeService.IssueTypeUpdateInput, IssueTypeService.UpdateValidationResult
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIssueTypeService
(ConstantsManager constantsManager, IssueTypeTypeAvatarService avatarService, I18nHelper i18n, GlobalPermissionManager globalPermissionManager, IssueTypeManager issueTypeManager, PermissionManager permissionManager, IssueTypeSchemeManager issueTypeSchemeManager, SubTaskManager subTaskManager, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptioncreateIssueType
(ApplicationUser user, IssueTypeService.CreateValidationResult validationResult) This method will store a new issue type in JIRA DB.void
deleteIssueType
(ApplicationUser user, IssueTypeService.DeleteValidationResult validationResult) Removes the issue from JIRA database and triggersIssueTypeDeletedEvent
.findIssueTypes
(ApplicationUser user, String substring) Returns issue types whose names start with or fully match given substring.findIssueTypes
(ApplicationUser user, String substring, @NotEmpty Set<Long> projectIds) Returns issue types whose names start with or fully match given substring.getAvailableAlternativesForIssueType
(ApplicationUser applicationUser, String id) Returns a collection of suitable alternativeIssueType
s to which issues with the supplied issue type can be moved to.io.atlassian.fugue.Option<IssueType>
getIssueType
(ApplicationUser applicationUser, String id) Returns an issue type for the given issue type id, if it is visible for the user.getIssueTypes
(ApplicationUser applicationUser) updateIssueType
(ApplicationUser user, IssueTypeService.UpdateValidationResult validationResult) This method will store the update issue type value in JIRA database and trigger a newIssueTypeUpdatedEvent
.validateCreateIssueType
(ApplicationUser user, IssueTypeService.IssueTypeCreateInput issueTypeCreateInput) This method validates the parameters for creation of an issue type and execute permission checks.validateDeleteIssueType
(ApplicationUser user, IssueTypeService.IssueTypeDeleteInput issueTypeDeleteInput) This method validates if it is possible to remove issue type with given id and executes permission checks.validateUpdateIssueType
(ApplicationUser user, String issueTypeId, IssueTypeService.IssueTypeUpdateInput issueTypeUpdateInput) This method validates the parameters for update of an issue type and execute permission checks.
-
Constructor Details
-
DefaultIssueTypeService
public DefaultIssueTypeService(ConstantsManager constantsManager, IssueTypeTypeAvatarService avatarService, I18nHelper i18n, GlobalPermissionManager globalPermissionManager, IssueTypeManager issueTypeManager, PermissionManager permissionManager, IssueTypeSchemeManager issueTypeSchemeManager, SubTaskManager subTaskManager, ApplicationProperties applicationProperties)
-
-
Method Details
-
getIssueType
public io.atlassian.fugue.Option<IssueType> getIssueType(ApplicationUser applicationUser, String id) Description copied from interface:IssueTypeService
Returns an issue type for the given issue type id, if it is visible for the user.- Specified by:
getIssueType
in interfaceIssueTypeService
- Parameters:
applicationUser
- user which requests access to the issue type.id
- of an issue type to return.- Returns:
- issue type for id.
-
getIssueTypes
- Specified by:
getIssueTypes
in interfaceIssueTypeService
- Parameters:
applicationUser
- user which requests access to issue types.- Returns:
- all issue types visible for the given user.
-
getAvailableAlternativesForIssueType
public Iterable<IssueType> getAvailableAlternativesForIssueType(ApplicationUser applicationUser, String id) Description copied from interface:IssueTypeService
Returns a collection of suitable alternativeIssueType
s to which issues with the supplied issue type can be moved to. The suitable alternativeIssueType
s will have to use the same workflow, the same field configuration and the same screen scheme.- Specified by:
getAvailableAlternativesForIssueType
in interfaceIssueTypeService
- Parameters:
applicationUser
- user which requests access to issue types.id
- of an issue type to find alternative for.- Returns:
- issue type alternative for issue type with given id.
-
validateCreateIssueType
public IssueTypeService.CreateValidationResult validateCreateIssueType(ApplicationUser user, @Nonnull IssueTypeService.IssueTypeCreateInput issueTypeCreateInput) Description copied from interface:IssueTypeService
This method validates the parameters for creation of an issue type and execute permission checks. If the checks pass the method constructs a new instance ofIssueTypeService.CreateValidationResult
which can be passed toIssueTypeService.createIssueType(ApplicationUser, CreateValidationResult)
.- Specified by:
validateCreateIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.issueTypeCreateInput
- this represents the issue type values.- Returns:
- an instance of
IssueTypeService.CreateValidationResult
.
-
createIssueType
public IssueTypeService.IssueTypeResult createIssueType(ApplicationUser user, @Nonnull IssueTypeService.CreateValidationResult validationResult) Description copied from interface:IssueTypeService
This method will store a new issue type in JIRA DB. This method will trigger a newIssueTypeCreatedEvent
.- Specified by:
createIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byIssueTypeService.validateCreateIssueType(ApplicationUser, com.atlassian.jira.config.IssueTypeService.IssueTypeCreateInput)
.- Returns:
- the result of issue type creation.
-
validateUpdateIssueType
public IssueTypeService.UpdateValidationResult validateUpdateIssueType(ApplicationUser user, @Nonnull String issueTypeId, @Nonnull IssueTypeService.IssueTypeUpdateInput issueTypeUpdateInput) Description copied from interface:IssueTypeService
This method validates the parameters for update of an issue type and execute permission checks. If checks pass the method constructs a new instance ofIssueTypeService.UpdateValidationResult
which can be passed toIssueTypeService.updateIssueType(ApplicationUser, UpdateValidationResult)
.- Specified by:
validateUpdateIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.issueTypeId
- issue type to update.issueTypeUpdateInput
- represents the issue type values.- Returns:
- an instance of
IssueTypeService.UpdateValidationResult
.
-
updateIssueType
public IssueTypeService.IssueTypeResult updateIssueType(ApplicationUser user, @Nonnull IssueTypeService.UpdateValidationResult validationResult) Description copied from interface:IssueTypeService
This method will store the update issue type value in JIRA database and trigger a newIssueTypeUpdatedEvent
.- Specified by:
updateIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byIssueTypeService.validateUpdateIssueType(ApplicationUser, String, com.atlassian.jira.config.IssueTypeService.IssueTypeUpdateInput)
.- Returns:
- the result of issue type creation.
-
validateDeleteIssueType
public IssueTypeService.DeleteValidationResult validateDeleteIssueType(ApplicationUser user, @Nonnull IssueTypeService.IssueTypeDeleteInput issueTypeDeleteInput) Description copied from interface:IssueTypeService
This method validates if it is possible to remove issue type with given id and executes permission checks.- Specified by:
validateDeleteIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.issueTypeDeleteInput
- issue type delete input.- Returns:
- an instance of
IssueTypeService.DeleteValidationResult
.
-
deleteIssueType
public void deleteIssueType(ApplicationUser user, @Nonnull IssueTypeService.DeleteValidationResult validationResult) Description copied from interface:IssueTypeService
Removes the issue from JIRA database and triggersIssueTypeDeletedEvent
. All issues which are associated to the removed issue type are going to be migrated to an alternative issue type.- Specified by:
deleteIssueType
in interfaceIssueTypeService
- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byIssueTypeService.validateDeleteIssueType(ApplicationUser, IssueTypeDeleteInput)
.
-
findIssueTypes
Description copied from interface:IssueTypeService
Returns issue types whose names start with or fully match given substring. Issue types that the calling user has no permissions to see are filtered out.- Specified by:
findIssueTypes
in interfaceIssueTypeService
- Parameters:
user
- the calling usersubstring
- the string that issue types names will be matched with
-
findIssueTypes
public Stream<IssueType> findIssueTypes(@Nullable ApplicationUser user, @Nonnull String substring, @NotEmpty @NotEmpty Set<Long> projectIds) Description copied from interface:IssueTypeService
Returns issue types whose names start with or fully match given substring. Only issue types available for given projects will be returned. Issue types that the calling user has no permissions to see are filtered out.- Specified by:
findIssueTypes
in interfaceIssueTypeService
- Parameters:
user
- the calling usersubstring
- the string that issue types names will be matched withprojectIds
- the set of issue type ids to filter issue types
-