public class DefaultIssueTypeSchemeService extends Object implements IssueTypeSchemeService
Constructor and Description |
---|
DefaultIssueTypeSchemeService(SearchService searchService,
IssueTypeSchemeManager issueTypeSchemeManager,
ProjectService projectService,
GlobalPermissionManager globalPermissionManager,
I18nHelper.BeanFactory i18nFactory,
IssueTypeService issueTypeService) |
Modifier and Type | Method and Description |
---|---|
ServiceOutcome<Void> |
addProjectAssociations(ApplicationUser user,
long schemeId,
List<String> projectIdsOrKeys)
Adds additional project-scheme associations between the issue type scheme specified by the
schemeId
and the projects given by the projectIdsOrKeys collection. |
ServiceOutcome<FieldConfigScheme> |
createIssueTypeScheme(ApplicationUser user,
String name,
String description,
List<String> issueTypeIds,
String defaultIssueTypeId)
Creates a new issue type scheme with the specified name, description, issue types, and default issue type.
|
ServiceOutcome<Void> |
deleteIssueTypeScheme(ApplicationUser user,
long schemeId)
Deletes the issue type scheme specified by the
schemeId . |
<T> ServiceOutcome<T> |
errorCase(String msg,
ErrorCollection.Reason reason)
Creates a failed service outcome with the specified error
msg and reason . |
ServiceOutcome<List<FieldConfigScheme>> |
getAllIssueTypeSchemes(ApplicationUser user)
Retrieves and returns all issue type schemes in the Jira.
|
ServiceOutcome<List<Project>> |
getAssociatedProjects(ApplicationUser user,
long schemeId)
Retrieves the project-scheme associations for the issue type scheme specified by the
schemeId . |
IssueType |
getDefaultIssueType(FieldConfigScheme issueTypeScheme)
Looks up and returns the default issue type (the one that is presented as the initial/selected choice to users
when creating a new Issue, for instance) for the specified issue type scheme.
|
List<Issue> |
getIssuesMatchingTypesInProjects(ApplicationUser user,
Collection<Long> projectIds,
Collection<String> issueTypeIds)
For the projects specified by
projectIds , finds the issues that are of the types given by
issueTypIds . |
ServiceOutcome<List<Issue>> |
getIssuesRequiringMigration(ApplicationUser user,
Collection<String> chosenIssueTypeIds,
List<Long> projectIds)
Figures out which issues in the specified projects would require migration if only the
chosenIssueTypeIds
were made available to the projects. |
ServiceOutcome<List<Issue>> |
getIssuesRequiringMigrationDueToSchemeAssociation(ApplicationUser user,
FieldConfigScheme issueTypeScheme,
List<Long> projectIds)
Figures out which issues in the specified projects would require migration if the given
issueTypeScheme
were to be associated with them. |
ServiceOutcome<FieldConfigScheme> |
getIssueTypeScheme(ApplicationUser user,
long schemeId)
Retrieves the issue type scheme specified by the
schemeId . |
long |
getNumIssuesMatchingTypesInProjects(ApplicationUser user,
Collection<Long> projectIds,
Collection<String> issueTypeIds)
For the projects specified by
projectIds , determines how many issues are of the types given by
issueTypIds . |
ServiceOutcome<Void> |
removeAllProjectAssociations(ApplicationUser user,
long schemeId)
Removes all project associations for the issue type scheme specified by the
schemeId . |
ServiceOutcome<Void> |
removeProjectAssociation(ApplicationUser user,
long schemeId,
String projKeyOrId)
For the issue type scheme specified by the
schemeId , removes the project association given by
projKeyOrId . |
ServiceOutcome<Void> |
setProjectAssociations(ApplicationUser user,
long schemeId,
List<String> projectIdsOrKeys)
Replaces the project-scheme associations for the issue type scheme specified by the
schemeId
with the projects given by the projectIdsOrKeys collection. |
ServiceOutcome<FieldConfigScheme> |
updateIssueTypeScheme(ApplicationUser user,
long schemeId,
String name,
String description,
List<String> issueTypeIds,
String defaultIssueTypeId)
Updates the issue type scheme specified by
schemeId to have the given name, description, issue types,
and default issue type. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProjectAssociations, createIssueTypeScheme, deleteIssueTypeScheme, getAssociatedProjects, getIssueTypeScheme, removeAllProjectAssociations, removeProjectAssociation, setProjectAssociations, updateIssueTypeScheme, updateIssueTypeScheme, updateIssueTypeScheme
public DefaultIssueTypeSchemeService(SearchService searchService, IssueTypeSchemeManager issueTypeSchemeManager, ProjectService projectService, GlobalPermissionManager globalPermissionManager, I18nHelper.BeanFactory i18nFactory, IssueTypeService issueTypeService)
public ServiceOutcome<FieldConfigScheme> createIssueTypeScheme(ApplicationUser user, String name, String description, List<String> issueTypeIds, String defaultIssueTypeId)
IssueTypeSchemeService
This operation will fail validation and return an unsuccessful outcome if:
issueTypeIds
createIssueTypeScheme
in interface IssueTypeSchemeService
user
- user that performs the create operation. Must be a Jira administrator.name
- what the new issue type scheme will be called. Must not be null or empty.description
- optional additional information about the new schemeissueTypeIds
- which issue types will be available to projects associated with this scheme. Must not be null
or empty.defaultIssueTypeId
- specifies which of the new scheme's issue types will be initially selected when creating
a new issue (in a project associated with this scheme). Can be null (meaning no default),
but otherwise must be an id found in issueTypeIds
.public ServiceOutcome<List<FieldConfigScheme>> getAllIssueTypeSchemes(ApplicationUser user)
IssueTypeSchemeService
This operation will fail validation and return an unsuccessful outcome if:
getAllIssueTypeSchemes
in interface IssueTypeSchemeService
user
- user that performs the retrieval operation. Must be a Jira administrator.public ServiceOutcome<FieldConfigScheme> getIssueTypeScheme(ApplicationUser user, long schemeId)
IssueTypeSchemeService
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
getIssueTypeScheme
in interface IssueTypeSchemeService
user
- user that performs the retrieval operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to retrieve.public ServiceOutcome<FieldConfigScheme> updateIssueTypeScheme(ApplicationUser user, long schemeId, String name, String description, List<String> issueTypeIds, String defaultIssueTypeId)
IssueTypeSchemeService
schemeId
to have the given name, description, issue types,
and default issue type. Project associations are not within the scope of this operation; use
setProjectAssociations
or
addProjectAssociations
instead.
This operation will fail validation and return an unsuccessful outcome if:
issueTypeIds
being assignedupdateIssueTypeScheme
in interface IssueTypeSchemeService
user
- user that performs the update operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to update.name
- what the issue type scheme will be called after the update. Must not be null or empty.description
- optional additional information about the updated schemeissueTypeIds
- which issue types will be available to projects associated with this scheme. Must not be null
or empty.defaultIssueTypeId
- specifies which of the scheme's issue types will be initially selected when creating
a new issue (in a project associated with this scheme). Can be null (meaning no default),
but otherwise must be an id found in issueTypeIds
being assigned.public ServiceOutcome<Void> deleteIssueTypeScheme(ApplicationUser user, long schemeId)
IssueTypeSchemeService
schemeId
. Any projects associated with this scheme will
revert to the global default issue type scheme.
This operation will fail validation and return an unsuccessful outcome if:
deleteIssueTypeScheme
in interface IssueTypeSchemeService
user
- user that performs the delete operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to delete.public ServiceOutcome<Void> addProjectAssociations(ApplicationUser user, long schemeId, List<String> projectIdsOrKeys)
IssueTypeSchemeService
schemeId
and the projects given by the projectIdsOrKeys
collection. This operation does not modify or remove
any existing project associations that the scheme has.
This operation will fail validation and return an unsuccessful outcome if:
projectIdsOrKeys
does not reference a valid projectaddProjectAssociations
in interface IssueTypeSchemeService
user
- user that performs the association operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to add project associations to.projectIdsOrKeys
- lookup keys/ids for projects to be associated with the issue type schemepublic ServiceOutcome<List<Project>> getAssociatedProjects(ApplicationUser user, long schemeId)
IssueTypeSchemeService
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
getAssociatedProjects
in interface IssueTypeSchemeService
user
- user that performs the association operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type schemeschemeId
or an error if something went wrong
during the operation.public ServiceOutcome<Void> setProjectAssociations(ApplicationUser user, long schemeId, List<String> projectIdsOrKeys)
IssueTypeSchemeService
schemeId
with the projects given by the projectIdsOrKeys
collection. Again, this operation overwrites any
existing project associations that the scheme has.
This operation will fail validation and return an unsuccessful outcome if:
projectIdsOrKeys
does not reference a valid projectsetProjectAssociations
in interface IssueTypeSchemeService
user
- user that performs the association operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme.projectIdsOrKeys
- lookup keys/ids for projects to be associated with the issue type schemepublic ServiceOutcome<Void> removeProjectAssociation(ApplicationUser user, long schemeId, String projKeyOrId)
IssueTypeSchemeService
schemeId
, removes the project association given by
projKeyOrId
.
This operation will fail validation and return an unsuccessful outcome if:
projectIdsOrKeys
does not reference a valid projectremoveProjectAssociation
in interface IssueTypeSchemeService
user
- user that performs the removal operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme.projKeyOrId
- key/id for the project that we're un-associating with the schemepublic ServiceOutcome<Void> removeAllProjectAssociations(ApplicationUser user, long schemeId)
IssueTypeSchemeService
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
removeAllProjectAssociations
in interface IssueTypeSchemeService
user
- user that performs the removal operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme.public long getNumIssuesMatchingTypesInProjects(ApplicationUser user, Collection<Long> projectIds, Collection<String> issueTypeIds) throws SearchException
IssueTypeSchemeService
projectIds
, determines how many issues are of the types given by
issueTypIds
. This functionality is provided as a separate hook, as it can be implemented more efficiently this
way rather than via getIssuesMatchingTypesInProjects(..).size()
.getNumIssuesMatchingTypesInProjects
in interface IssueTypeSchemeService
user
- user that performs the lookup operation.projectIds
- unique identifiers for the projects whose issues we'd like to inspect.issueTypeIds
- unique identifiers for the issue types that we're looking for instances of in the projects.issueTypeIds
SearchException
public List<Issue> getIssuesMatchingTypesInProjects(ApplicationUser user, Collection<Long> projectIds, Collection<String> issueTypeIds) throws SearchException
IssueTypeSchemeService
projectIds
, finds the issues that are of the types given by
issueTypIds
. Note: rather than calling .size() on the results of this method, use the more efficient
getNumIssuesMatchingTypesInProjects(...)
instead.getIssuesMatchingTypesInProjects
in interface IssueTypeSchemeService
user
- user that performs the lookup operation.projectIds
- unique identifiers for the projects whose issues we'd like to inspect.issueTypeIds
- unique identifiers for the issue types that we're looking for instances of in the projects.issueTypeIds
SearchException
public ServiceOutcome<List<Issue>> getIssuesRequiringMigration(ApplicationUser user, Collection<String> chosenIssueTypeIds, List<Long> projectIds)
IssueTypeSchemeService
chosenIssueTypeIds
were made available to the projects.getIssuesRequiringMigration
in interface IssueTypeSchemeService
user
- user that performs the lookup operation.chosenIssueTypeIds
- collection of issue type ids against which we're checking the need for issue migrations.projectIds
- collection of unique identifiers for the projects whose issues may require migration.public ServiceOutcome<List<Issue>> getIssuesRequiringMigrationDueToSchemeAssociation(ApplicationUser user, FieldConfigScheme issueTypeScheme, List<Long> projectIds)
IssueTypeSchemeService
issueTypeScheme
were to be associated with them.getIssuesRequiringMigrationDueToSchemeAssociation
in interface IssueTypeSchemeService
user
- user that performs the lookup operation.issueTypeScheme
- issue type scheme against which we're checking the need for issue migrations.projectIds
- collection of unique identifiers for the projects whose issues may require migration.public <T> ServiceOutcome<T> errorCase(String msg, ErrorCollection.Reason reason)
IssueTypeSchemeService
msg
and reason
.errorCase
in interface IssueTypeSchemeService
T
- generic type that corresponds with what the successful outcome would have been.msg
- string explanation of the failure.reason
- Motivation/reason behind the failure.public IssueType getDefaultIssueType(FieldConfigScheme issueTypeScheme)
IssueTypeSchemeService
getDefaultIssueType
in interface IssueTypeSchemeService
issueTypeScheme
- scheme whose default issue type we'd like to look up.Copyright © 2002-2019 Atlassian. All Rights Reserved.