This document describes the REST API and resources provided by JIRA. The REST APIs are for developers who want to integrate JIRA into their application and for administrators who want to script interactions with the JIRA server.
JIRA's REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. Currently, the only supported reponse format is JSON. Your methods will be the standard HTTP methods like GET, PUT, POST and DELETE (see API descriptions below for which methods are available for each resource).
Because the REST API is based on open standards, you can use any web development language to access the API.
URIs for JIRA's REST API resource have the following structure:
With context: http://host:port/context/rest/api-name/api-version/resource-name
Or without context: http://host:port/rest/api-name/api-version/resource-name
Currently, the are two api-names available 'api' and 'auth'. REST endpoints in the 'api' path allow you to access most of the information contained within an issue. The current api-version is 2.0.alpha1. REST endpoints in the 'auth' path allow you to access information related to authentication. The current api-version is 1.
Example with context: http://myhost.com:8080/jira/rest/api/2.0.alpha1/project/JRA
Example without context: http://myhost.com:8080/rest/api/2.0.alpha1/project/JRA
In order to minimise network traffic from the client perspective, our API uses a technique called expansion.
You can use the 'expand' query parameter to specify a comma-separated list of entities that you want expanded, identifying each entity by a given identifier. For example, the value "comments,worklogs" requests the expansion of entities for which the expand identifier is "comments" and worklogs".
To discover the identifiers for each entity, look at the 'expand' attribute in the parent object. In the JSON example below, the object declares widgets as being expandable.
Note: The 'expand' attribute should not be confused with the 'expand' query parameter which specifies which entities you want expanded.
You can use the dot notation to specify expansion of entities within another entity. For example "children.children" would expand the children and the children's children (because its expand identifier is children) and the child entities within the plugin.
All methods return accept and return JSON exclusively. Example:
{
"expand": "widgets",
"self": "http://www.example.com/jira/rest/api/resource/KEY-1",
"widgets": {
"widgets": [],
"size": 5
}
}
This documents the current REST API provided by JIRA.
parameter | value | description |
---|---|---|
id | the attachment id |
Issue attachments
parameter | value | description |
---|---|---|
issueKey | the issue that you want to add the attachments to |
Add one or more attachments to an issue. In order to protect against XSRF attacks, because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: nocheck with the request, otherwise it will be blocked.
available response representations:
parameter | value | description |
---|---|---|
id | a String containing the work log id |
parameter | value | description |
---|---|---|
id | the ID of the comment to request |
Returns a single issue comment.
parameter | value | description |
---|---|---|
render | Default: true | true if text fields should be rendered according to the renderer associated with them; false to return the raw, unrendered data |
available response representations:
Returns general information about the current JIRA server.
available response representations:
parameter | value | description |
---|---|---|
id | a String containing the component key |
parameter | value | description |
---|---|---|
id | a String containing the resolution id |
parameter | value | description |
---|---|---|
id | a String containing the priority id |
Rest resource to retrieve a list of issue link types.
parameter | value | description |
---|---|---|
issueLinkTypeId |
parameter | value | description |
---|---|---|
id | a numeric Status id |
The Link Issue Resource provides functionality to manage issue links.
Creates an issue link between two issues. The user requires the link issue permission for the issue which will be linked to another issue. The specified link type in the request is used to create the link and will create a link from the first issue to the second issue using the outward description. It also create a link from the second issue to the first issue using the inward description of the issue link type. It will add the supplied comment to the first issue. The comment can have a restriction who can view it. If group is specified, only users of this group can view this comment, if roleLevel is specified only users who have the specified role can view this comment. The user who creates the issue link needs to belong to the specified group or have the specified role.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
key | the project key |
parameter | value | description |
---|---|---|
issueKey | the issue key to request (i.e. JRA-1330) |
parameter | value | description |
---|---|---|
issueKey | the issue you want to transition |
Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.
available response representations:
Perform a transition on an issue. The POST must contain a single JSON Object. It must have a "transition" string and a "fields" object. A "comment" is optional. The comment can be either a simple string or an object with a "body" and "role" or "group".
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
issueKey | the issue to view voting information for |
Remove your vote from an issue. (i.e. "unvote")
available response representations:
Cast your vote in favour of an issue.
available response representations:
parameter | value | description |
---|---|---|
issueKey | a String containing an issue key |
Returns the list of watchers for the issue with the given key.
available response representations:
parameter | value | description |
---|---|---|
userName | a String containing the name of the user to remove from the watcher list | |
issueKey | a String containing an issue key |
Resource for searches.
Searches for issues using JQL. If the JQL query is too large to be encoded as a query param you should instead POST to this resource.
parameter | value | description |
---|---|---|
jql | a JQL query string | |
startAt | the index of the first issue to return (0-based) | |
maxResults | the maximum number of issues to return (defaults to 50). The maximum allowable value is dictated by the JIRA property 'jira.search.views.default.max'. If you specify a value that is higher than this number, your search results will be truncated. |
available response representations:
parameter | value | description |
---|---|---|
id | a String containing an issue type id |
parameter | value | description |
---|---|---|
id | a String containing the version id |
Implement a REST resource for acquiring a session cookie.
Login a user to JIRA.
acceptable request representations:
available response representations:
Get information about the current user. If the current user is anonymous they will get a permission denied error trying to access this resource. The response contains information about the current user. It will contain their username, login information, and a link to the User Resource for the user.
available response representations: