Package com.atlassian.jira.config
Interface IssueTypeService
- All Known Implementing Classes:
DefaultIssueTypeService
@PublicApi
public interface IssueTypeService
Service for managing issue types.
- Since:
- 6.4
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static class
static class
static class
static class
static class
static class
-
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.
-
Method Details
-
getIssueType
Returns an issue type for the given issue type id, if it is visible for the user.- Parameters:
applicationUser
- user which requests access to the issue type.id
- of an issue type to return.- Returns:
- issue type for id.
-
getIssueTypes
- Parameters:
applicationUser
- user which requests access to issue types.- Returns:
- all issue types visible for the given user.
-
getAvailableAlternativesForIssueType
Iterable<IssueType> getAvailableAlternativesForIssueType(ApplicationUser applicationUser, String id) 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.- 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
IssueTypeService.CreateValidationResult validateCreateIssueType(ApplicationUser user, @Nonnull IssueTypeService.IssueTypeCreateInput issueTypeCreateInput) 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 tocreateIssueType(ApplicationUser, CreateValidationResult)
.- Parameters:
user
- against whom the permission checks will be run.issueTypeCreateInput
- this represents the issue type values.- Returns:
- an instance of
IssueTypeService.CreateValidationResult
.
-
createIssueType
IssueTypeService.IssueTypeResult createIssueType(ApplicationUser user, @Nonnull IssueTypeService.CreateValidationResult validationResult) This method will store a new issue type in JIRA DB. This method will trigger a newIssueTypeCreatedEvent
.- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byvalidateCreateIssueType(ApplicationUser, com.atlassian.jira.config.IssueTypeService.IssueTypeCreateInput)
.- Returns:
- the result of issue type creation.
-
validateUpdateIssueType
IssueTypeService.UpdateValidationResult validateUpdateIssueType(ApplicationUser user, @Nonnull String issueTypeId, @Nonnull IssueTypeService.IssueTypeUpdateInput issueTypeUpdateInput) 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 toupdateIssueType(ApplicationUser, UpdateValidationResult)
.- 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
IssueTypeService.IssueTypeResult updateIssueType(ApplicationUser user, @Nonnull IssueTypeService.UpdateValidationResult validationResult) This method will store the update issue type value in JIRA database and trigger a newIssueTypeUpdatedEvent
.- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byvalidateUpdateIssueType(ApplicationUser, String, com.atlassian.jira.config.IssueTypeService.IssueTypeUpdateInput)
.- Returns:
- the result of issue type creation.
-
validateDeleteIssueType
IssueTypeService.DeleteValidationResult validateDeleteIssueType(ApplicationUser user, @Nonnull IssueTypeService.IssueTypeDeleteInput issueTypeDeleteInput) This method validates if it is possible to remove issue type with given id and executes permission checks.- Parameters:
user
- against whom the permission checks will be run.issueTypeDeleteInput
- issue type delete input.- Returns:
- an instance of
IssueTypeService.DeleteValidationResult
.
-
deleteIssueType
void deleteIssueType(ApplicationUser user, @Nonnull IssueTypeService.DeleteValidationResult validationResult) 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.- Parameters:
user
- against whom the permission checks will be run.validationResult
- validation result returned byvalidateDeleteIssueType(ApplicationUser, IssueTypeDeleteInput)
.
-
findIssueTypes
@ExperimentalApi Stream<IssueType> findIssueTypes(@Nullable ApplicationUser user, @Nonnull String substring) 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.- Parameters:
user
- the calling usersubstring
- the string that issue types names will be matched with- Since:
- 9.1
-
findIssueTypes
@ExperimentalApi Stream<IssueType> findIssueTypes(@Nullable ApplicationUser user, @Nonnull String substring, @NotEmpty @NotEmpty Set<Long> projectIds) 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.- 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- Since:
- 9.2
-