Package com.atlassian.jira.rest.v2.issue
Class IssueTypeSchemeResource
java.lang.Object
com.atlassian.jira.rest.v2.issue.IssueTypeSchemeResource
@Path("issuetypescheme")
@Consumes("application/json")
@Produces("application/json")
public class IssueTypeSchemeResource
extends Object
Resource for managing issue type schemes and their project associations.
An issue type scheme is a named, ordered collection of issue types that is associated with 0..n projects. The contents of the associated issue type scheme determine which issue types are available to a project.
As is the case with issue type deletion, certain changes
to an issue type scheme require issue migrations on the part of affected projects. This resource does not support
such migrations, and users are encouraged to use the GUI to perform them when necessary.
- Since:
- v8.0
-
Constructor Summary
ConstructorsConstructorDescriptionIssueTypeSchemeResource(JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, IssueTypeService issueTypeService, ResponseFactory responseFactory, OptionSetManager optionSetManager, ProjectBeanFactory projectBeanFactory, IssueTypeSchemeService issueTypeSchemeService, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddProjectAssociationsToScheme(String schemeId, AssociateProjectsBean assocProjects) Adds additional projects to those already associated with the specified issue type scheme.jakarta.ws.rs.core.ResponsecreateIssueTypeScheme(IssueTypeSchemeCreateUpdateBean createBean) Creates an issue type scheme from a JSON representation.jakarta.ws.rs.core.ResponsedeleteIssueTypeScheme(String schemeId) Deletes the specified issue type scheme.jakarta.ws.rs.core.ResponseReturns a list of all issue type schemes visible to the user (must be admin).jakarta.ws.rs.core.ResponsegetAssociatedProjects(String schemeId, String expand) For the specified issue type scheme, returns all of the associated projects.jakarta.ws.rs.core.ResponsegetIssueTypeScheme(String schemeId) Returns a full representation of the issue type scheme that has the given id (must be admin).jakarta.ws.rs.core.ResponseremoveAllProjectAssociations(String schemeId) Removes all project associations for the specified issue type scheme.jakarta.ws.rs.core.ResponseremoveProjectAssociation(String schemeId, String projIdOrKey) For the specified issue type scheme, removes the given project association .jakarta.ws.rs.core.ResponsesetProjectAssociationsForScheme(String schemeId, AssociateProjectsBean assocProjects) Associates the given projects with the specified issue type scheme.jakarta.ws.rs.core.ResponseupdateIssueTypeScheme(String schemeId, IssueTypeSchemeCreateUpdateBean updateBean) Updates the specified issue type scheme from a JSON representation.
-
Constructor Details
-
IssueTypeSchemeResource
@Inject public IssueTypeSchemeResource(JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, IssueTypeService issueTypeService, ResponseFactory responseFactory, OptionSetManager optionSetManager, ProjectBeanFactory projectBeanFactory, IssueTypeSchemeService issueTypeSchemeService, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
createIssueTypeScheme
@POST public jakarta.ws.rs.core.Response createIssueTypeScheme(IssueTypeSchemeCreateUpdateBean createBean) Creates an issue type scheme from a JSON representation. (Admin required)- Parameters:
createBean-- Returns:
- a JSON representation of the newly created IssueTypeScheme if successful; an error response otherwise.
- Since:
- 8.0
-
getAllIssueTypeSchemes
@GET public jakarta.ws.rs.core.Response getAllIssueTypeSchemes()Returns a list of all issue type schemes visible to the user (must be admin).- Returns:
- a list of issue type schemes
- Since:
- 8.0
-
getIssueTypeScheme
@GET @Path("{schemeId}") public jakarta.ws.rs.core.Response getIssueTypeScheme(@PathParam("schemeId") String schemeId) Returns a full representation of the issue type scheme that has the given id (must be admin).- Parameters:
schemeId- a String containing an issue type scheme's id- Returns:
- a full representation of the issue type scheme with the given id
- Since:
- 8.0
-
updateIssueTypeScheme
@PUT @Path("{schemeId}") public jakarta.ws.rs.core.Response updateIssueTypeScheme(@PathParam("schemeId") String schemeId, IssueTypeSchemeCreateUpdateBean updateBean) Updates the specified issue type scheme from a JSON representation. (Admin required)- Parameters:
schemeId- the id of the issue type scheme to update.updateBean- specifies the new set of attributes that the issue type scheme will take on.- Returns:
- a JSON representation of the updated issue type scheme.
- Since:
- 8.0
-
deleteIssueTypeScheme
@DELETE @Path("{schemeId}") public jakarta.ws.rs.core.Response deleteIssueTypeScheme(@PathParam("schemeId") String schemeId) Deletes the specified issue type scheme. Any projects associated with this IssueTypeScheme will be automatically associated with the global default IssueTypeScheme. (Admin required)- Parameters:
schemeId- the id of the issue type scheme to remove.- Returns:
- an empty 204 result indicating that the delete was successful, an error code otherwise
- Since:
- 8.0
-
addProjectAssociationsToScheme
@POST @Path("{schemeId}/associations") public jakarta.ws.rs.core.Response addProjectAssociationsToScheme(@PathParam("schemeId") String schemeId, AssociateProjectsBean assocProjects) throws SearchException Adds additional projects to those already associated with the specified issue type scheme. (Admin required)- Parameters:
schemeId- the id of the issue type scheme whose project associations we're adding to.assocProjects- collection of projects, specified by id or key, to associate with this issue type scheme- Returns:
- an empty result indicating that the association was successful, an error code otherwise
- Throws:
SearchException- Since:
- 8.0
-
getAssociatedProjects
@GET @Path("{schemeId}/associations") public jakarta.ws.rs.core.Response getAssociatedProjects(@PathParam("schemeId") String schemeId, @QueryParam("expand") String expand) For the specified issue type scheme, returns all of the associated projects. (Admin required)- Parameters:
schemeId- id of the issue type scheme whose projects we're accessingexpand- the parameters to expand on the returned projects; defaults to none.- Returns:
- the collection of projects associated with this issue type scheme; an error if unsuccessful.
- Since:
- 8.0
-
setProjectAssociationsForScheme
@PUT @Path("{schemeId}/associations") public jakarta.ws.rs.core.Response setProjectAssociationsForScheme(@PathParam("schemeId") String schemeId, AssociateProjectsBean assocProjects) throws SearchException Associates the given projects with the specified issue type scheme. Any existing project-associations the issue type scheme has will be overwritten. (Admin required)- Parameters:
schemeId- the id of the issue type scheme whose project associations we're replacing.assocProjects- collection of projects, specified by id or key, to associate with this issue type scheme- Returns:
- an empty result indicating that the association was successful, an error code otherwise
- Throws:
SearchException- Since:
- 8.0
-
removeAllProjectAssociations
@DELETE @Path("{schemeId}/associations") public jakarta.ws.rs.core.Response removeAllProjectAssociations(@PathParam("schemeId") String schemeId) Removes all project associations for the specified issue type scheme. These projects revert to an association with the default/global issue type scheme.(Admin required)- Parameters:
schemeId- the id of the issue type scheme whose project associations we're removing- Returns:
- confirmation that the associations were removed; an error message otherwise.
- Since:
- 8.0
-
removeProjectAssociation
@DELETE @Path("{schemeId}/associations/{projIdOrKey}") public jakarta.ws.rs.core.Response removeProjectAssociation(@PathParam("schemeId") String schemeId, @PathParam("projIdOrKey") String projIdOrKey) For the specified issue type scheme, removes the given project association . This project reverts to an association with the default/global issue type scheme.(Admin required)- Parameters:
schemeId- the id of the issue type scheme whose project association we're removingprojIdOrKey- the id or key of the project that is to be un-associated with the issue type scheme- Returns:
- confirmation that the association was removed; an error message otherwise.
- Since:
- 8.0
-