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 |
---|---|
getIssue | Gets the specified issue. |
createIssue | Creates a new issue. |
updateIssue | Updates an issue. |
updateIssueAssignee | Assigns the issue to the specified user. |
getTransitions | Gets a list of transitions the current user can perform for an issue. |
doTransition | Performs a transition on an issue. |
getComments | Gets the comments for an issue. |
postComment | Posts a comment on an issue. |
updateComment | Updates an existing comment. |
deleteComment | Deletes an existing comment. |
addAttachmentToIssueId | Adds an attachment to an issue. |
getIssuePriorities | Gets the available priorities for issues. |
getIssuePriorityById | Gets information about a specific priority. |
getIssueTypes | Gets the available types of issues. |
getIssueTypeById | Gets information about a specific issue type. |
getVotesForIssue | Gets the votes for an issue. |
createBulkIssue | Creates many issues in one bulk operation. |
assignIssueToUser | Assigns an issue to a user. |
getCommentById | Retrieves all comments for an issue. |
sendNotification | Sends a notification (e-mail) to the list or recipients defined in the request. |
addVotesForIssue | Casts your vote in favour of an issue. |
getWatchersForIssue | Retrieves the list of watchers for the issue with the given key. |
removeUserFromWatcherList | Removes a user from an issue's watcher list. |
Following is more information about these operations.
Getting an issue
To get an existing issue, use getIssue
and specify the issue ID.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getDashboardById operation.
{ "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
Creating an issue
To create a new issue (or task), use createIssue
and set the following properties.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the createIssue operation.
{ "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
Updating an issue
To update an issue, use updateIssue
, specify the issue ID.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the updateIssue operation.
{ "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
Assigning an issue to another user
To assign an issue to another user, use updateIssueAssignee
, specify the issue ID
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the updateIssueAssignee operation.
{ "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
Getting transitions
To get a list of the possible transitions the current user can perform for an issue, use getTransitions
and specify the issue ID.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getTransitions operation.
{ "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
Performing transitions
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.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the doTransitions operation.
{ "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
Getting comments
To get the comments for an issue, use getComments
and specify the issue ID.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getComments operation.
{ "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
Posting a comment
To post a comment to an issue, use postComment
and specify the following properties.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the postComment operation.
{ "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
Updating a comment
To update an existing comment, use updateComment
operation.
<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.
{ "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
Deleting a comment
To delete an existing comment, use 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
Adding attachments to an issue
To add one or more attachments to an issue, use addAttachmentToIssueId
, specify the issue ID.
<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
Getting priorities
To get the priorities available for issues, use getIssuePriorities
. This operation returns detailed information about each priority, including its name, ID, and more.
<jira.getIssuePriorities/>
Sample request
Following is a sample REST/JSON request that can be handled by the getIssuePriorities operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1817
Getting information on a priority
To get information on a specific priority, use getIssuePriorityById
and specify the priority ID.
<jira.getIssuePriorityById> <issuePriorityId>{$ctx:issuePriorityId}</issuePriorityId> </jira.getIssuePriorityById>
Properties
issuePriorityId
: Identifies the priority whose information you want to retrieve.
Sample request
Following is a sample REST/JSON request that can be handled by the getIssuePriorityById operation.
{ "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
Getting issue types
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.
<jira.getIssueTypes/>
Sample request
Following is a sample REST/JSON request that can be handled by the getIssueTypes operation.
{ "username":"admin", "password":"jira@jaffna", "uri":"https://testcon.atlassian.net" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e704
Getting information on an issue type
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getIssueTypeById operation.
{ "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
Getting votes for an issue
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.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getVotesForIssue operation.
{ "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
Creating many issues in one bulk operation
This operation creates many issues in one bulk operation.
<jira.createBulkIssue> <issueUpdates>{$ctx:issueUpdates}</issueUpdates> </jira.createBulkIssue>
Properties
issueUpdates
: The array of objects containing the issue details.
Sample request
Following is a sample REST/JSON request that can be handled by the createBulkIssue operation.
{ "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
Assigning an issue to a user
This operation assigns an issue to a user.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the assignIssueToUser operation.
{ "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
Retrieving all comments for an issue
This operation retrieves all comments for an issue.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the getCommentById operation.
{ "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
Sending a notification to the list or recipients
This operation sends a notification (e-mail) to the list or recipients defined in the request.
<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.
Sample request
Following is a sample REST/JSON request that can be handled by the sendNotification operation.
{ "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
Casting your vote in favour of an issue
This operation casts your vote in favour of an issue.
<jira.addVotesForIssue> <issueId>{$ctx:issueId}</issueId> </jira.addVotesForIssue>
Properties
issueId
: The ID of the issues that the vote is made for.
Sample request
Following is a sample REST/JSON request that can be handled by the addVotesForIssue operation.
{ "uri": "https://testappmahesh.atlassian.net", "username": "testapp.mahesh2", "password": "1qaz2wsx@", "issueId":"TP-1" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1133
Retrieving the list of watchers for the issue with the given key
This operation retrieves the list of watchers for the issue with the given key.
<jira.getWatchersForIssue> <issueId>{$ctx:issueId}</issueId> </jira.getWatchersForIssue>
Properties
issueId
: The string containing an issue key.
Sample request
Following is a sample REST/JSON request that can be handled by the getWatchersForIssue operation.
{ "uri":"https://connector.atlassian.net", "username":"admin", "password":"1qaz2wsx@", "issueId":"TESTPM1-3" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1232
Removing a user from an issue's watcher list
This operation removes a user from an issue's watcher list.
<jira.removeUserFromWatcherList> <name>{$ctx:name}</name> <issueId>{$ctx:issueId}</issueId> </jira.removeUserFromWatcherList>
Properties
name
: String containing the name of the user to remove.issueId
: String containing an issue key.
Sample request
Following is a sample REST/JSON request that can be handled by the removeUserFromWatcherList operation.
{ "uri":"https://connector.atlassian.net", "username":"admin", "password":"1qaz2wsx@", "issueId":"TESTPM1-3", "name" : "rasika" }
Related JIRA API
https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1274
Sample Configuration
Following is a sample proxy service that illustrates how to connect to Jira with the init operation and use the addAttachmentToIssueId operation.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="addAttachmentToIssueId" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <jira.init> <username>{$url:username}</username> <password>{$url:password}</password> <uri>{$url:uri}</uri> </jira.init> <jira.addAttachmentToIssueId> <issueIdOrKey>{$url:issueIdOrKey}</issueIdOrKey> </jira.addAttachmentToIssueId> <respond/> </inSequence> <outSequence/> <faultSequence/> </target> <description/> </proxy>