@PublicApi
public interface IssueTypeSchemeService
Note, this service does not support issue type migrations. Issue type scheme updates and project associations that require migrations will fail and return with error outcomes.
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. |
default ServiceOutcome<Void> |
addProjectAssociations(ApplicationUser user,
String 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. |
default ServiceOutcome<FieldConfigScheme> |
createIssueTypeScheme(ApplicationUser user,
String name,
String description,
List<String> issueTypeIds)
Creates a new issue type scheme with the specified name, description, issue types, and an unspecified default issue
type.
|
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 . |
default ServiceOutcome<Void> |
deleteIssueTypeScheme(ApplicationUser user,
String 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 . |
default ServiceOutcome<List<Project>> |
getAssociatedProjects(ApplicationUser user,
String 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 . |
default ServiceOutcome<FieldConfigScheme> |
getIssueTypeScheme(ApplicationUser user,
String 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 . |
default ServiceOutcome<Void> |
removeAllProjectAssociations(ApplicationUser user,
String 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 . |
default ServiceOutcome<Void> |
removeProjectAssociation(ApplicationUser user,
String 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)
Deprecated.
|
default ServiceOutcome<Void> |
setProjectAssociations(ApplicationUser user,
String 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. |
default ServiceOutcome<FieldConfigScheme> |
updateIssueTypeScheme(ApplicationUser user,
long schemeId,
String name,
String description,
List<String> issueTypeIds)
Updates the issue type scheme specified by
schemeId to have the given name, description, issue types,
and an unspecified default issue type. |
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. |
default ServiceOutcome<FieldConfigScheme> |
updateIssueTypeScheme(ApplicationUser user,
String schemeId,
String name,
String description,
List<String> issueTypeIds)
Updates the issue type scheme specified by
schemeId to have the given name, description, issue types,
and an unspecified default issue type. |
default ServiceOutcome<FieldConfigScheme> |
updateIssueTypeScheme(ApplicationUser user,
String 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. |
ServiceOutcome<FieldConfigScheme> createIssueTypeScheme(ApplicationUser user, String name, String description, List<String> issueTypeIds, String defaultIssueTypeId)
This operation will fail validation and return an unsuccessful outcome if:
issueTypeIds
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
.default ServiceOutcome<FieldConfigScheme> createIssueTypeScheme(ApplicationUser user, String name, String description, List<String> issueTypeIds)
This operation will fail validation and return an unsuccessful outcome if:
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.ServiceOutcome<List<FieldConfigScheme>> getAllIssueTypeSchemes(ApplicationUser user)
This operation will fail validation and return an unsuccessful outcome if:
user
- user that performs the retrieval operation. Must be a Jira administrator.ServiceOutcome<FieldConfigScheme> getIssueTypeScheme(ApplicationUser user, long schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
user
- user that performs the retrieval operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to retrieve.default ServiceOutcome<FieldConfigScheme> getIssueTypeScheme(ApplicationUser user, String schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
user
- user that performs the retrieval operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to retrieve.ServiceOutcome<FieldConfigScheme> updateIssueTypeScheme(ApplicationUser user, long schemeId, String name, String description, List<String> issueTypeIds, String defaultIssueTypeId)
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 assigneduser
- 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.default ServiceOutcome<FieldConfigScheme> updateIssueTypeScheme(ApplicationUser user, String schemeId, String name, String description, List<String> issueTypeIds, String defaultIssueTypeId)
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 assigneduser
- 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.default ServiceOutcome<FieldConfigScheme> updateIssueTypeScheme(ApplicationUser user, long schemeId, String name, String description, List<String> issueTypeIds)
schemeId
to have the given name, description, issue types,
and an unspecified 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:
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.default ServiceOutcome<FieldConfigScheme> updateIssueTypeScheme(ApplicationUser user, String schemeId, String name, String description, List<String> issueTypeIds)
schemeId
to have the given name, description, issue types,
and an unspecified 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:
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.ServiceOutcome<Void> deleteIssueTypeScheme(ApplicationUser user, long schemeId)
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:
user
- user that performs the delete operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to delete.default ServiceOutcome<Void> deleteIssueTypeScheme(ApplicationUser user, String schemeId)
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:
user
- user that performs the delete operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme to delete.ServiceOutcome<Void> addProjectAssociations(ApplicationUser user, long schemeId, List<String> projectIdsOrKeys)
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 projectuser
- 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 schemedefault ServiceOutcome<Void> addProjectAssociations(ApplicationUser user, String schemeId, List<String> projectIdsOrKeys)
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 projectuser
- 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 schemeServiceOutcome<List<Project>> getAssociatedProjects(ApplicationUser user, long schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
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.default ServiceOutcome<List<Project>> getAssociatedProjects(ApplicationUser user, String schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
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.@Deprecated ServiceOutcome<Void> setProjectAssociations(ApplicationUser user, long schemeId, List<String> projectIdsOrKeys)
addProjectAssociations(ApplicationUser, long, List)
& removeProjectAssociation(ApplicationUser, long, String)
insteadschemeId
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 projectuser
- 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 schemedefault ServiceOutcome<Void> setProjectAssociations(ApplicationUser user, String schemeId, List<String> projectIdsOrKeys)
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 projectuser
- 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 schemeServiceOutcome<Void> removeAllProjectAssociations(ApplicationUser user, long schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
user
- user that performs the removal operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme.default ServiceOutcome<Void> removeAllProjectAssociations(ApplicationUser user, String schemeId)
schemeId
.
This operation will fail validation and return an unsuccessful outcome if:
user
- user that performs the removal operation. Must be a Jira administrator.schemeId
- unique id that references an existing issue type scheme.ServiceOutcome<Void> removeProjectAssociation(ApplicationUser user, long schemeId, String projKeyOrId)
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 projectuser
- 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 schemedefault ServiceOutcome<Void> removeProjectAssociation(ApplicationUser user, String schemeId, String projKeyOrId)
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 projectuser
- 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 schemeServiceOutcome<List<Issue>> getIssuesRequiringMigration(ApplicationUser user, Collection<String> chosenIssueTypeIds, List<Long> projectIds)
chosenIssueTypeIds
were made available to the projects.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.ServiceOutcome<List<Issue>> getIssuesRequiringMigrationDueToSchemeAssociation(ApplicationUser user, FieldConfigScheme issueTypeScheme, List<Long> projectIds)
issueTypeScheme
were to be associated with them.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.long getNumIssuesMatchingTypesInProjects(ApplicationUser user, Collection<Long> projectIds, Collection<String> issueTypeIds) throws SearchException
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()
.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
List<Issue> getIssuesMatchingTypesInProjects(ApplicationUser user, Collection<Long> projectIds, Collection<String> issueTypeIds) throws SearchException
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.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
<T> ServiceOutcome<T> errorCase(String msg, ErrorCollection.Reason reason)
msg
and reason
.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.IssueType getDefaultIssueType(FieldConfigScheme issueTypeScheme)
issueTypeScheme
- scheme whose default issue type we'd like to look up.Copyright © 2002-2022 Atlassian. All Rights Reserved.