public class IssueTypeResource extends Object
| Constructor and Description |
|---|
IssueTypeResource(JiraAuthenticationContext authContext,
ContextUriInfo contextUriInfo,
JiraBaseUrls jiraBaseUrls,
IssueTypeService issueTypeService,
I18nHelper i18n,
XsrfInvocationChecker xsrfChecker,
AvatarResourceHelper avatarResourceHelper,
GlobalPermissionManager globalPermissionManager,
ResponseFactory responseFactory) |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createAvatarFromTemporary(String issueTypeId,
AvatarCroppingBean croppingInstructions)
Converts temporary avatar into a real avatar
|
javax.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 |
getIssueAllTypes()
Returns a list of all issue types visible to the user
|
javax.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 |
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.common.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.
|
public IssueTypeResource(JiraAuthenticationContext authContext, ContextUriInfo contextUriInfo, JiraBaseUrls jiraBaseUrls, IssueTypeService issueTypeService, I18nHelper i18n, XsrfInvocationChecker xsrfChecker, AvatarResourceHelper avatarResourceHelper, GlobalPermissionManager globalPermissionManager, ResponseFactory responseFactory)
public javax.ws.rs.core.Response getIssueAllTypes()
public javax.ws.rs.core.Response getIssueType(String issueTypeId)
issueTypeId - a String containing an issue type idpublic javax.ws.rs.core.Response getAlternativeIssueTypes(String issueTypeId)
public javax.ws.rs.core.Response createIssueType(IssueTypeCreateBean issueTypeCreateBean)
issueTypeCreateBean - public javax.ws.rs.core.Response deleteIssueType(String issueTypeId, String alternativeIssueTypeId)
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.public javax.ws.rs.core.Response updateIssueType(String issueTypeId, IssueTypeUpdateBean issueTypeUpdateBean)
issueTypeId - the id of the issue type to update.issueTypeUpdateBean - public javax.ws.rs.core.Response storeTemporaryAvatar(String issueTypeId, String filename, Long size, @Context javax.servlet.http.HttpServletRequest request)
The following examples shows these three steps using curl. The cookies (session) need to be preserved between requests, hence the use of -b and -c. The id created in step 2 needs to be passed to step 3 (you can simply pass the whole response of step 2 as the request of step 3).
curl -c cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \
-H "Content-Type: image/png" --data-binary @mynewavatar.png \
'http://localhost:8090/jira/rest/api/2/issuetype/1/avatar/temporary?filename=mynewavatar.png'
curl -b cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \
-H "Content-Type: application/json" --data '{"cropperWidth": "65","cropperOffsetX": "10","cropperOffsetY": "16"}' \
-o tmpid.json \
http://localhost:8090/jira/rest/api/2/issuetype/1/avatar
curl -b cookiejar.txt -X PUT -u admin:admin -H "X-Atlassian-Token: no-check" \
-H "Content-Type: application/json" --data-binary @tmpid.json \
http://localhost:8090/jira/rest/api/2/issuetype/1/avatar
issueTypeId - the id of the issue type, which avatar is updated.filename - name of file being uploadedsize - size of filerequest - servlet requestpublic javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(String issueTypeId, com.atlassian.plugins.rest.common.multipart.FilePart filePart, @Context javax.servlet.http.HttpServletRequest request)
Creating a temporary avatar is part of a 3-step process in uploading a new avatar for an issue type: upload, crop, confirm. This endpoint allows you to use a multipart upload instead of sending the image directly as the request body.
You *must* use "avatar" as the name of the upload parameter:
curl -c cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \ -F "avatar=@mynewavatar.png;type=image/png" \ 'http://localhost:8090/jira/rest/api/2/issuetype/1/avatar/temporary'
issueTypeId - the id of the issue type, which avatar is updated.request - servlet requestpublic javax.ws.rs.core.Response createAvatarFromTemporary(String issueTypeId, AvatarCroppingBean croppingInstructions)
issueTypeId - the id of the issue type, which avatar is updated.croppingInstructions - cropping instructionsCopyright © 2002-2019 Atlassian. All Rights Reserved.