Package com.atlassian.jira.rest.v2.issue
Class IssueTypeResource
java.lang.Object
com.atlassian.jira.rest.v2.issue.IssueTypeResource
@Path("issuetype")
@Consumes("application/json")
@Produces("application/json")
public class IssueTypeResource
extends Object
- Since:
- 4.2
-
Constructor Summary
ConstructorsConstructorDescriptionIssueTypeResource
(JiraAuthenticationContext authContext, javax.ws.rs.core.UriInfo contextUriInfo, JiraBaseUrls jiraBaseUrls, IssueTypeService issueTypeService, I18nHelper i18n, XsrfInvocationChecker xsrfChecker, AvatarResourceHelper avatarResourceHelper, GlobalPermissionManager globalPermissionManager, ResponseFactory responseFactory) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
createAvatarFromTemporary
(String issueTypeId, AvatarCroppingBean croppingInstructions) Converts temporary avatar into a real avatarjavax.ws.rs.core.Response
createIssueType
(IssueTypeCreateBean issueTypeCreateBean) Creates an issue type from a JSON representation and adds the issue newly created issue type to the default issue type scheme.javax.ws.rs.core.Response
deleteIssueType
(String issueTypeId, String alternativeIssueTypeId) Deletes the specified issue type.javax.ws.rs.core.Response
getAlternativeIssueTypes
(String issueTypeId) Returns a list of all alternative issue types for the given issue type id.javax.ws.rs.core.Response
Returns a list of all issue types visible to the userjavax.ws.rs.core.Response
getIssueType
(String issueTypeId) Returns a full representation of the issue type that has the given id.javax.ws.rs.core.Response
getPaginatedIssueTypes
(javax.ws.rs.core.UriInfo uriInfo, String requestedWith, Long startAt, Integer maxResults, String query, Set<Long> projectIds) Returns paginated list of filtered issue typesjavax.ws.rs.core.Response
storeTemporaryAvatar
(String issueTypeId, String filename, Long size, javax.servlet.http.HttpServletRequest request) Creates temporary avatar.javax.ws.rs.core.Response
storeTemporaryAvatarUsingMultiPart
(String issueTypeId, com.atlassian.plugins.rest.api.multipart.FilePart filePart, javax.servlet.http.HttpServletRequest request) Creates temporary avatar using multipart.javax.ws.rs.core.Response
updateIssueType
(String issueTypeId, IssueTypeUpdateBean issueTypeUpdateBean) Updates the specified issue type from a JSON representation.
-
Constructor Details
-
IssueTypeResource
@Inject public IssueTypeResource(JiraAuthenticationContext authContext, javax.ws.rs.core.UriInfo contextUriInfo, JiraBaseUrls jiraBaseUrls, IssueTypeService issueTypeService, I18nHelper i18n, XsrfInvocationChecker xsrfChecker, AvatarResourceHelper avatarResourceHelper, GlobalPermissionManager globalPermissionManager, ResponseFactory responseFactory)
-
-
Method Details
-
getIssueAllTypes
@GET public javax.ws.rs.core.Response getIssueAllTypes()Returns a list of all issue types visible to the user- Returns:
- a list of issue types
-
getIssueType
@GET @Path("{id}") public javax.ws.rs.core.Response getIssueType(@PathParam("id") String issueTypeId) Returns a full representation of the issue type that has the given id.- Parameters:
issueTypeId
- a String containing an issue type id- Returns:
- a full representation of the issue type with the given id
-
getAlternativeIssueTypes
@GET @Path("{id}/alternatives") public javax.ws.rs.core.Response getAlternativeIssueTypes(@PathParam("id") String issueTypeId) Returns a list of all alternative issue types for the given issue type id. The list will contain these issues types, to which issues assigned to the given issue type can be migrated. The suitable alternatives are issue types which are assigned to the same workflow, the same field configuration and the same screen scheme.- Returns:
- a list of issue types
-
createIssueType
Creates an issue type from a JSON representation and adds the issue newly created issue type to the default issue type scheme.- Parameters:
issueTypeCreateBean
-- Returns:
- Since:
- 6.4
-
deleteIssueType
@DELETE @Path("{id}") public javax.ws.rs.core.Response deleteIssueType(@PathParam("id") String issueTypeId, @QueryParam("alternativeIssueTypeId") String alternativeIssueTypeId) Deletes the specified issue type. If the issue type has any associated issues, these issues will be migrated to the alternative issue type specified in the parameter. You can determine the alternative issue types by calling the /rest/api/2/issuetype/{id}/alternatives resource.- Parameters:
issueTypeId
- the id of the issue type to remove.alternativeIssueTypeId
- the id of an issue type to which issues associated with the removed issue type will be migrated.- Since:
- 6.4
-
updateIssueType
@PUT @Path("{id}") public javax.ws.rs.core.Response updateIssueType(@PathParam("id") String issueTypeId, IssueTypeUpdateBean issueTypeUpdateBean) Updates the specified issue type from a JSON representation.- Parameters:
issueTypeId
- the id of the issue type to update.issueTypeUpdateBean
-- Returns:
- Since:
- 6.4
-
storeTemporaryAvatar
@POST @Consumes("*/*") @Path("{id}/avatar/temporary") public javax.ws.rs.core.Response storeTemporaryAvatar(@PathParam("id") String issueTypeId, @QueryParam("filename") String filename, @QueryParam("size") Long size, @Context javax.servlet.http.HttpServletRequest request) Creates temporary avatar. Creating a temporary avatar is part of a 3-step process in uploading a new avatar for an issue type: upload, crop, confirm.- Parameters:
issueTypeId
- the id of the issue type, which avatar is updated.filename
- name of file being uploadedsize
- size of filerequest
- servlet request- Returns:
- temporary avatar cropping instructions
- Since:
- 6.4
-
storeTemporaryAvatarUsingMultiPart
@POST @Consumes("multipart/form-data") @Path("{id}/avatar/temporary") @Produces("text/html") public javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(@PathParam("id") String issueTypeId, com.atlassian.plugins.rest.api.multipart.FilePart filePart, @Context javax.servlet.http.HttpServletRequest request) Creates temporary avatar using multipart. The response is sent back as JSON stored in a textarea. This is because the client uses remote iframing to submit avatars using multipart. So we must send them a valid HTML page back from which the client parses the JSON from.- Parameters:
issueTypeId
- the id of the issue type, which avatar is updated.request
- servlet request- Returns:
- temporary avatar cropping instructions
- Since:
- 6.4
-
createAvatarFromTemporary
@POST @Path("{id}/avatar") public javax.ws.rs.core.Response createAvatarFromTemporary(@PathParam("id") String issueTypeId, AvatarCroppingBean croppingInstructions) Converts temporary avatar into a real avatar- Parameters:
issueTypeId
- the id of the issue type, which avatar is updated.croppingInstructions
- cropping instructions- Returns:
- created avatar
- Since:
- 6.4
-
getPaginatedIssueTypes
@GET @Path("page") @Produces("application/json") @ExperimentalApi public javax.ws.rs.core.Response getPaginatedIssueTypes(@Context javax.ws.rs.core.UriInfo uriInfo, @HeaderParam("X-Requested-With") String requestedWith, @DefaultValue("0") @QueryParam("startAt") Long startAt, @DefaultValue("100") @QueryParam("maxResults") Integer maxResults, @DefaultValue("") @QueryParam("query") String query, @QueryParam("projectIds") Set<Long> projectIds) Returns paginated list of filtered issue types- Parameters:
startAt
- the index of the first issue type to returnmaxResults
- the maximum number of issue type to returnquery
- the string that issue type names will be matched withprojectIds
- the set of project ids to filter issue types- Since:
- 9.1
-