This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Issues in JIRA
The following operations are available for working with issues.Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with issues, see Sample configuration .
Operation | Description |
|---|---|
Gets the specified issue. | |
Creates a new issue. | |
Updates an issue. | |
Assigns the issue to the specified user. | |
Gets a list of transitions the current user can perform for an issue. | |
Performs a transition on an issue. | |
Gets the comments for an issue. | |
Posts a comment on an issue. | |
Updates an existing comment. | |
Deletes an existing comment. | |
Adds an attachment to an issue. | |
Gets the available priorities for issues. | |
Gets information about a specific priority. | |
Gets the available types of issues. | |
Gets information about a specific issue type. | |
Gets the votes for an issue. | |
Creates many issues in one bulk operation. | |
Assigns an issue to a user. | |
Retrieves all comments for an issue. | |
Sends a notification (e-mail) to the list or recipients defined in the request. | |
Casts your vote in favour of an issue. | |
Retrieves the list of watchers for the issue with the given key. | |
Removes a user from an issue's watcher list. |
Following is more information about these operations.
To get an existing issue, use getIssue and specify the issue ID.
getIssue
<jira.getIssue>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<fields>{$ctx:fields}</fields>
<expand>{$ctx:expand}</expand>
</jira.getIssue>Properties
issueIdOrKey: Identifies the issue to retrieve. This can be an issue ID, or an issue key.
fields : The list of fields to return for the issue.
expand : The parameters to expand.
Following is a sample REST/JSON request that can be handled by the getDashboardById operation.
Sample request for getDashboardById
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-1"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1160
To create a new issue (or task), use createIssue and set the following properties.
createIssue
<jira.createIssue>
<projectKey>{$ctx:projectKey}</projectKey>
<issueFields>{$ctx:issueFields}</issueFields>
</jira.createIssue>Properties
projectKey: The key (unique identifier) of the project in which you are creating the issue.issueFields: Fields of the issue.
Following is a sample REST/JSON request that can be handled by the createIssue operation.
Sample request for createIssue
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueFields":{
"fields": {
"project":{
"key": "TEST1"
},
"summary": "Hello",
"description": "test issue",
"issuetype": {
"id": "10006"
}
}
}
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e864
To update an issue, use updateIssue, specify the issue ID.
updateIssue
<jira.updateIssue>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<issueFields>{$ctx:issueFields}</issueFields>
</jira.updateIssue>Properties
issueIdOrKey: The key (unique identifier) of the issue.
issueFields: Fields of the issue.
Following is a sample REST/JSON request that can be handled by the updateIssue operation.
Sample request for updateIssue
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-6",
"issueFields":{
"update":{
"summary":[
{
"set":"Bug in business logic"
}
],
"labels":[
{
"add":"triaged"
},
{
"remove":"blocker"
}
]
}
}
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1209
To assign an issue to another user, use updateIssueAssignee, specify the issue ID
updateIssueAssignee
<jira.updateIssueAssignee>
<name>{$ctx:name}</name>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
</jira.updateIssueAssignee>Properties
issueIdOrKey: Identifies the issue to update. This can be an issue ID, or an issue key.name : The username of the user.
Following is a sample REST/JSON request that can be handled by the updateIssueAssignee operation.
Sample request for updateIssueAssignee
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"name":"admin",
"issueIdOrKey":"TEST-2"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e924
To get a list of the possible transitions the current user can perform for an issue, use getTransitions and specify the issue ID.
getTransitions
<jira.getTransitions>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<expand>{$ctx:expand}</expand>
</jira.getTransitions>Properties
issueIdOrKey: Identifies the issue to update. This can be an issue ID, or an issue key.expand: The parameters to expand.
Following is a sample REST/JSON request that can be handled by the getTransitions operation.
Sample request for getTransitions
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-2"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074
To perform a transition on an issue, use doTransition, specify the issue ID, and include the transition ID along with any other updates you want to make using the following properties.
doTransition
<jira.doTransition>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<issueFields>{$ctx:issueFields}</issueFields>
</jira.doTransition>Properties
issueIdOrKey: Identifies the issue to update. This can be an issue ID, or an issue key.issueFields: Fields of the issue.
Following is a sample REST/JSON request that can be handled by the doTransitions operation.
Sample request for doTransitions
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-2"
"issueFields":{
"update": {
"comment": [
{
"add": {
"body": "Bug has been fixed."
}
}
]
},
"transition": {
"id": "11"
}
}
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1097
To get the comments for an issue, use getComments and specify the issue ID.
getComments
<jira.getComments>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<expand>{$ctx:expand}</expand>
</jira.getComments>Properties
issueIdOrKey: Identifies the issue whose comments you want to get. This can be an issue ID, or an issue key.expand: The parameters to expand.
Following is a sample REST/JSON request that can be handled by the getComments operation.
Sample request for getComments
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-2"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e957
To post a comment to an issue, use postComment and specify the following properties.
postComment
<jira.postComment>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<comment>{$ctx:comment}</comment>
<visibleRole>{$ctx:visibleRole}</visibleRole>
<expand>{$ctx:expand}</expand>
</jira.postComment>Properties
issueIdOrKey: Identifies the issue to which you are adding this comment. This can be an issue ID, or an issue key.Comment: The text to post as the comment.visibleRole: User role that can view the comment.expand: The parameters to expand.
Following is a sample REST/JSON request that can be handled by the postComment operation.
Sample request for postComment
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-1",
"comment":"Waiting to hear back from the legal department.",
"visibleRole":"Administrators"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e978
To update an existing comment, use updateComment operation.
updateComment
<jira.updateComment>
<commentId>{$ctx:commentId}</commentId>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<comment>{$ctx:comment}</comment>
<visibleRole>{$ctx:visibleRole}</visibleRole>
</jira.updateComment>Properties
issueIdOrKey: Identifies the issue whose comment you are updating. This can be an issue ID, or an issue key. If the issue cannot be found via an exact match, JIRA will also look for the issue in a case-insensitive way, or by looking to see if the issue was moved.commentId: Identifies the comment you are updating.comment: A string containing the comment to be postedvisibleRole: A String containing the visible role.expand: The optional flags: renderedBody (provides body rendered in HTML).
Sample request
Following is a sample REST/JSON request that can be handled by the updateComment operation.
Sample request for updateComment
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-1",
"commentId":"10100",
"comment":"is this a bug?",
"visibleRole":"Administrators"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1035
To delete an existing comment, use deleteComment.
deleteComment
<jira.deleteComment>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<commentId>{$ctx:commentId}</commentId>
</jira.deleteComment>Properties
issueIdOrKey: Identifies the issue whose comment you are deleting. This can be an issue ID, or an issue key.commentId: Identifies the comment you are deleting.
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1064
To add one or more attachments to an issue, use addAttachmentToIssueId, specify the issue ID.
addAttachmentToIssueId
<jira.addAttachmentToIssueId>
<issueIdOrKey>{$url:issueIdOrKey}</issueIdOrKey>
</jira.addAttachmentToIssueId>Multipart processing
Multipart/form-data cannot be processed inside the ESB. Therefore, the ESB should be in a content-unaware status. To achieve this, configure a pass-through proxy, and then build the message from the client end and send it to the proxy.
Properties
issueIdOrKey: Identifies the issue to which you are adding attachments. This can be an issue ID, or an issue key.
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e3258
To get the priorities available for issues, use getIssuePriorities. This operation returns detailed information about each priority, including its name, ID, and more.
getIssuePriorities
<jira.getIssuePriorities/>
Following is a sample REST/JSON request that can be handled by the getIssuePriorities operation.
Sample request for getIssuePriorities
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1817
To get information on a specific priority, use getIssuePriorityById and specify the priority ID.
getIssuePriorityById
<jira.getIssuePriorityById>
<issuePriorityId>{$ctx:issuePriorityId}</issuePriorityId>
</jira.getIssuePriorityById>Properties
issuePriorityId: Identifies the priority whose information you want to retrieve.
Following is a sample REST/JSON request that can be handled by the getIssuePriorityById operation.
Sample request for getIssuePriorityById
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issuePriorityId":"1"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1832
To get the types of issues available in this JIRA instance, use getIssueTypes. This operation returns detailed information about each issue type, including its name, ID, and more.
getIssueTypes
<jira.getIssueTypes/>
Following is a sample REST/JSON request that can be handled by the getIssueTypes operation.
Sample request for getIssueTypes
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e704
getIssueTypeById
<jira.getIssueTypeById>
<issueTypeId>{$ctx:issueTypeId}</issueTypeId>
</jira.getIssueTypeById>To get information on a specific issue type, use jira.getIssueTypeById and specify the type ID.
Properties
issueTypeId: Identifies the issue type whose information you want to retrieve.
Following is a sample REST/JSON request that can be handled by the getIssueTypeById operation.
Sample request for getIssueTypeById
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueTypeId":"3"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e719
To get the votes for a specific issue, use getVotesForIssue and specify the issue ID. This operation returns a JSON representation of the vote information, including the number of votes and more.
getVotesForIssue
<jira.getVotesForIssue>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
</jira.getVotesForIssue>Properties
issueIdOrKey: Identifies the issue whose votes you want to get. This can be an issue ID, or an issue key.
Following is a sample REST/JSON request that can be handled by the getVotesForIssue operation.
Sample request for getVotesForIssue
{
"username":"admin",
"password":"jira@jaffna",
"uri":"https://testcon.atlassian.net",
"issueIdOrKey":"TEST-1"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1143
This operation creates many issues in one bulk operation.
createBulkIssue
<jira.createBulkIssue>
<issueUpdates>{$ctx:issueUpdates}</issueUpdates>
</jira.createBulkIssue>Properties
issueUpdates: The array of objects containing the issue details.
Following is a sample REST/JSON request that can be handled by the createBulkIssue operation.
Sample request for createBulkIssue
{
"uri": "https://connector.atlassian.net",
"username": "admin",
"password": "1qaz2wsx@",
"issueUpdates": [
{
"update": {},
"fields": {
"project": {
"id": "10001"
},
"summary": "something's very wrong",
"issuetype": {
"id": "10002"
}
}
}
]
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1295
This operation assigns an issue to a user.
assignIssueToUser
<jira.assignIssueToUser>
<name>{$ctx:name}</name>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
</jira.assignIssueToUser>Properties
name: The name of the assignee.issueIdOrKey: A String containing an issue key.
Following is a sample REST/JSON request that can be handled by the assignIssueToUser operation.
Sample request for assignIssueToUser
{
"uri": "https://connector.atlassian.net",
"username": "admin",
"password": "1qaz2wsx@",
"name": "vrajenthiran",
"issueIdOrKey": "WSO2CON-4"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e928
This operation retrieves all comments for an issue.
getCommentById
<jira.getCommentById>
<commentId>{$ctx:commentId}</commentId>
<expand>{$ctx:expand}</expand>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
</jira.getCommentById>Properties
commentId: The unique identifier of the comment.expand: The optional flags: renderedBody (provides body rendered in HTML).issueIdOrKey: A string containing the issue ID or key the comment belongs to.
Following is a sample REST/JSON request that can be handled by the getCommentById operation.
Sample request for getCommentById
{
"uri": "https://connector.atlassian.net",
"username": "admin",
"password": "1qaz2wsx@",
"commentId" : "10001",
"issueIdOrKey":"TESTPM1-3"
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1014
This operation sends a notification (e-mail) to the list or recipients defined in the request.
sendNotification
<jira.sendNotification>
<subject>{$ctx:subject}</subject>
<issueIdOrKey>{$ctx:issueIdOrKey}</issueIdOrKey>
<textBody>{$ctx:textBody}</textBody>
<htmlBody>{$ctx:htmlBody}</htmlBody>
<toReporter>{$ctx:toReporter}</toReporter>
<toAssignee>{$ctx:toAssignee}</toAssignee>
<toWatchers>{$ctx:toWatchers}</toWatchers>
<toVoters>{$ctx:toVoters}</toVoters>
<toUsers>{$ctx:toUsers}</toUsers>
<toGroups>{$ctx:toGroups}</toGroups>
<restrictGroups>{$ctx:restrictGroups}</restrictGroups>
<restrictPermissions>{$ctx:restrictPermissions}</restrictPermissions>
</jira.sendNotification>Properties
subject: The subject of the notification.issueIdOrKey: A string containing the issue ID or key the comment will be added to.textBody: The text body of the notification.htmlBody: The HTML body of the notification.toReporter: The boolean flag to indicate whether to notify the reporter.toAssignee: The boolean flag to indicate whether to notify the assignee.toWatchers: The boolean flag to indicate whether to notify the watchers.toVoters: The boolean flag to indicate whether to notify the voters.toUsers: The boolean flag to indicate whether to notify the users.toGroups: The array of notification groups to be notified.restrictGroups: The Array of notification groups to be restricted.restrictPermissions: The array of restricted permissions for the notification.
Following is a sample REST/JSON request that can be handled by the sendNotification operation.
Sample request for sendNotification
{
"uri": "https://connector.atlassian.net",
"username": "admin",
"password": "1qaz2wsx@",
"issueIdOrKey" : "TESTPM1-3",
"subject" : "notification subject",
"textBody":"The text body",
"htmlBody":"Lorem ipsum <strong>dolor</strong> sit amet, consectetur adipiscing elit. Pellentesque eget",
"toReporter":"false",
"toAssignee":"false",
"toWatchers":"true",
"toVoters":"true",
"toUsers":[
{
"name": "vrajenthiran",
"active": false
}
],
"toGroups":[
{
"name": "notification-group",
"self": "http://www.example.com/jira/rest/api/2/group?groupname=notification-group"
}
],
"restrictPermissions":[
{
"id": "10",
"key": "BROWSE"
}
], "restrictGroups": [
{
"name": "notification-group",
"self": "http://www.example.com/jira/rest/api/2/group?groupname=notification-group"
}
]
}Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e902
This operation casts your vote in favour of an issue.
addVotesForIssue
<jira.addVotesForIssue>
<issueId>{$ctx:issueId}</issueId>
</jira.addVotesForIssue>