[go: up one dir, main page]

0% found this document useful (0 votes)
87 views39 pages

Untitled Document

This document provides an overview of the Jira Server platform REST API. It describes how to authenticate to the API, the URI structure, pagination, expansion, and error handling. It also lists the available API resources and their associated methods.

Uploaded by

Vishal Hirapara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views39 pages

Untitled Document

This document provides an overview of the Jira Server platform REST API. It describes how to authenticate to the API, the URI structure, pagination, expansion, and error handling. It also lists the available API resources and their associated methods.

Uploaded by

Vishal Hirapara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Welcome to the Jira Server platform REST API reference.

You can use this REST API to build apps


for Jira, develop integrations between Jira and other applications, or script interactions with Jira. This
page documents the REST resources available in Jira Server platform, along with expected HTTP
response codes and sample requests.

Looking for the REST API reference for a different Jira version? Follow the links below.

● Jira Cloud platform REST API


● List of all Jira REST APIs

Getting started
If you haven't integrated with Jira Server before, read the Getting started guide in the Jira Server
developer documentation. You may also want to read our Jira REST API overview, which describes
how the Jira REST APIs work, including a simple example of a REST call.

Authentication
The preferred authentication methods for the Jira REST APIs are OAuth and HTTP basic
authentication (when using SSL).

Jira itself uses cookie-based authentication in the browser, so you can call REST from JavaScript on
the page and rely on the authentication that the browser has established. To reproduce the behavior
of the Jira log-in page (for example, to display authentication error messages to users) can POST to
the /auth/1/session resource.

URI Structure
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. The Jira REST API uses JSON
as its communication format, and the standard HTTP methods like GET, PUT, POST and DELETE
(see API descriptions below for which methods are available for each resource). URIs for Jira's
REST API resource have the following structure:

http://host:port/context/rest/api-name/api-version/resource-name

Currently there are two API names available, which will be discussed further below:

● auth - for authentication-related operations, and


● api - for everything else.
The current API version is 2. However, there is also a symbolic version, called latest, which resolves
to the latest version supported by the given Jira instance. As an example, if you wanted to retrieve
the JSON representation of issue JRA-9 from Atlassian's public issue tracker, you would access:

https://jira.atlassian.com/rest/api/latest/issue/JRA-9

There is a WADL document that contains the documentation for each resource in the Jira REST API.
It is available here.

Expansion
In order to simplify API responses, the Jira REST API uses resource expansion. This means the API
will only return parts of the resource when explicitly requested.

You can use the expand query parameter to specify a comma-separated list of entities that you want
expanded, identifying each of them by name. For example, appending
?expand=names,renderedFields to an issue's URI requests the inclusion of the translated field
names and the HTML-rendered field values in the response. Continuing with our example above, we
would use the following URL to get that information for JRA-9:

https://jira.atlassian.com/rest/api/latest/issue/JRA-9?expand=names,renderedFields

To discover the identifiers for each entity, look at the expand property in the parent object. In the
JSON example below, the resource declares widgets as being expandable.
{

"expand": "widgets",

"self": "http://www.example.com/jira/rest/api/resource/KEY-1",
"widgets": {

"widgets": [],

"size": 5

You can use the dot notation to specify expansion of entities within another entity. For example
?expand=widgets.fringels would expand the widgets collection and also the fringel property on each
widget.
Pagination
Jira uses pagination to limit the response size for resources that return a potentially large collection
of items. A request to a paged API will result in a values array wrapped in a JSON object with some
paging metadata, for example:
{

"startAt" : 0,

"maxResults" : 10,

"total": 200,
"values": [

{ /* result 0 */ },

{ /* result 1 */ },

{ /* result 2 */ }

]
}

Clients can use the "startAt" and "maxResults" parameters to retrieve the desired numbers of
results.

The "maxResults" parameter indicates how many results to return per page. Each API may have a
different limit for number of items returned.

The "startAt" parameter indicates which item should be used as the first item in the page of results.

Important: The response contains a "total" field which denotes the total number of entities contained
in all pages. This number may change as the client requests the subsequent pages. A client should
always assume that the requested page can be empty. REST API consumers should also consider
the field to be optional. In cases, when calculating this value is too expensive we may not include
this in response.

Ordering
Some resources support ordering by a specific field. Ordering request is provided in the orderBy
query parameter. See the docs for specific methods to see which fields they support and if they
support ordering at all.

Ordering can be ascending or descending. By default it's ascending. To specify the ordering use "-"
or "+" sign. Examples:

?orderBy=name

Order by "name" ascending

?orderBy=+name

Order by "name" ascending

?orderBy=-name

Order by "name" descending


Experimental methods
Methods marked as experimental may change without an earlier notice. We are looking for your
feedback for these methods.

Special request and response headers

● X-AUSERNAME - Response header which contains either username of the authenticated


user or 'anonymous'.
● X-Atlassian-Token - methods which accept multipart/form-data will only process requests
with 'X-Atlassian-Token: no-check' header.

Error responses
Most resources will return a response body in addition to the status code. Usually, the JSON schema
of the entity returned is the following:

"id": "https://docs.atlassian.com/jira/REST/schema/error-collection#",
"title": "Error Collection",

"type": "object",

"properties": {

"errorMessages": {

"type": "array",
"items": {

"type": "string"

},

"errors": {
"type": "object",

"patternProperties": {

".+": {

"type": "string"

}
},

"additionalProperties": false

},

"status": {

"type": "integer"
}

},

"additionalProperties": false

ResourcesExpand all methods

api/2Expand all methods


Provide permission information for the current user.

Get permissions

GET /rest/api/2/mypermissions

Get all permissions

GET /rest/api/2/permissions

api/2/application-propertiesExpand all methods

Get property

GET /rest/api/2/application-properties

Set property via restful table

PUT /rest/api/2/application-properties/{id}

Get advanced settings

GET
/rest/api/2/application-properties/advanced-se
ttings

api/2/applicationroleExpand all methods

Provides REST access to Jira's Application Roles.

Put bulk

PUT /rest/api/2/applicationrole

Get all
GET /rest/api/2/applicationrole

Get

GET /rest/api/2/applicationrole/{key}

Put

PUT /rest/api/2/applicationrole/{key}

api/2/attachmentExpand all methods

Remove attachment

DELETE /rest/api/2/attachment/{id}

Get attachment

GET /rest/api/2/attachment/{id}

Expand for humans EXPERIMENTAL

GET
/rest/api/2/attachment/{id}/expand/human

Expand for machines EXPERIMENTAL

GET /rest/api/2/attachment/{id}/expand/raw

Get attachment meta

GET /rest/api/2/attachment/meta

api/2/auditingExpand all methods

Resource representing the auditing records


Add record DEPRECATED

POST /rest/api/2/auditing/record

Get records DEPRECATED

GET /rest/api/2/auditing/record

api/2/avatarExpand all methods

Get all system avatars

GET /rest/api/2/avatar/{type}/system

Store temporary avatar

POST /rest/api/2/avatar/{type}/temporary

Create avatar from temporary

POST /rest/api/2/avatar/{type}/temporaryCrop

api/2/clusterExpand all methods

It gives possibility to manage old node in cluster.

Get all nodes

GET /rest/api/2/cluster/nodes

Request current index from node

PUT
/rest/api/2/cluster/index-snapshot/{nodeId}

Delete node
DELETE /rest/api/2/cluster/node/{nodeId}

Change node state to offline

PUT /rest/api/2/cluster/node/{nodeId}/offline

api/2/cluster/zduExpand all methods

Approve upgrade

POST /rest/api/2/cluster/zdu/approve

Cancel upgrade

POST /rest/api/2/cluster/zdu/cancel

Acknowledge errors

POST /rest/api/2/cluster/zdu/retryUpgrade

Set ready to upgrade

POST /rest/api/2/cluster/zdu/start

Get state

GET /rest/api/2/cluster/zdu/state

api/2/comment/{commentId}/propertiesExpand all methods

Get properties keys EXPERIMENTAL

GET
/rest/api/2/comment/{commentId}/properties

Delete property EXPERIMENTAL


DELETE
/rest/api/2/comment/{commentId}/properties/{
propertyKey}

Set property EXPERIMENTAL

PUT
/rest/api/2/comment/{commentId}/properties/{
propertyKey}

Get property EXPERIMENTAL

GET
/rest/api/2/comment/{commentId}/properties/{
propertyKey}

api/2/componentExpand all methods

Create component

POST /rest/api/2/component

Update component

PUT /rest/api/2/component/{id}

Get component

GET /rest/api/2/component/{id}

Delete

DELETE /rest/api/2/component/{id}

Get component related issues


GET
/rest/api/2/component/{id}/relatedIssueCounts

Get paginated components EXPERIMENTAL

GET /rest/api/2/component/page

api/2/configurationExpand all methods

Get configuration

GET /rest/api/2/configuration

api/2/customFieldOptionExpand all methods

Get custom field option

GET /rest/api/2/customFieldOption/{id}

api/2/customFieldsExpand all methods

Get custom fields

GET /rest/api/2/customFields

Bulk delete custom fields

DELETE /rest/api/2/customFields

Get custom field options EXPERIMENTAL

GET
/rest/api/2/customFields/{customFieldId}/optio
ns

api/2/dashboardExpand all methods


List

GET /rest/api/2/dashboard

Get dashboard

GET /rest/api/2/dashboard/{id}

api/2/dashboard/{dashboardId}/items/{itemId}/propertiesExpand all
methods

Get properties keys

GET
/rest/api/2/dashboard/{dashboardId}/items/{ite
mId}/properties

Delete property

DELETE
/rest/api/2/dashboard/{dashboardId}/items/{ite
mId}/properties/{propertyKey}

Set property

PUT
/rest/api/2/dashboard/{dashboardId}/items/{ite
mId}/properties/{propertyKey}

Get property

GET
/rest/api/2/dashboard/{dashboardId}/items/{ite
mId}/properties/{propertyKey}

api/2/email-templatesExpand all methods


Upload email templates

POST /rest/api/2/email-templates

Download email templates

GET /rest/api/2/email-templates

Apply email templates

POST /rest/api/2/email-templates/apply

Revert email templates to default

POST /rest/api/2/email-templates/revert

Get email types

GET /rest/api/2/email-templates/types

api/2/fieldExpand all methods

Create custom field

POST /rest/api/2/field

Get fields

GET /rest/api/2/field

api/2/filterExpand all methods

Resource for searches.

Create filter
POST /rest/api/2/filter

Delete filter

DELETE /rest/api/2/filter/{id}

Edit filter

PUT /rest/api/2/filter/{id}

Get filter

GET /rest/api/2/filter/{id}

Default columns

GET /rest/api/2/filter/{id}/columns

Set columns

PUT /rest/api/2/filter/{id}/columns

Reset columns

DELETE /rest/api/2/filter/{id}/columns

Get share permissions

GET /rest/api/2/filter/{id}/permission

Add share permission

POST /rest/api/2/filter/{id}/permission

Get share permission


GET
/rest/api/2/filter/{id}/permission/{permissionId}

Delete share permission

DELETE
/rest/api/2/filter/{id}/permission/{permission-id
}

Get default share scope

GET /rest/api/2/filter/defaultShareScope

Set default share scope

PUT /rest/api/2/filter/defaultShareScope

Get favourite filters

GET /rest/api/2/filter/favourite

api/2/groupExpand all methods

Create group

POST /rest/api/2/group

Get group DEPRECATED

GET /rest/api/2/group

Remove group

DELETE /rest/api/2/group

Get users from group


GET /rest/api/2/group/member

Remove user from group

DELETE /rest/api/2/group/user

Add user to group

POST /rest/api/2/group/user

api/2/groupsExpand all methods

REST endpoint for searching groups in a group picker

Find groups

GET /rest/api/2/groups/picker

api/2/groupuserpickerExpand all methods

Find users and groups

GET /rest/api/2/groupuserpicker

api/2/index/summaryExpand all methods

REST resource for index summary

Get index summary EXPERIMENTAL

GET /rest/api/2/index/summary

api/2/issueExpand all methods

Create issue
POST /rest/api/2/issue

Create issues

POST /rest/api/2/issue/bulk

Get issue

GET /rest/api/2/issue/{issueIdOrKey}

Delete issue

DELETE /rest/api/2/issue/{issueIdOrKey}

Edit issue

PUT /rest/api/2/issue/{issueIdOrKey}

Archive issue

PUT /rest/api/2/issue/{issueIdOrKey}/archive

Assign

PUT
/rest/api/2/issue/{issueIdOrKey}/assignee

Get comments

GET
/rest/api/2/issue/{issueIdOrKey}/comment

Add comment

POST
/rest/api/2/issue/{issueIdOrKey}/comment
Update comment

PUT
/rest/api/2/issue/{issueIdOrKey}/comment/{id}

Delete comment

DELETE
/rest/api/2/issue/{issueIdOrKey}/comment/{id}

Get comment

GET
/rest/api/2/issue/{issueIdOrKey}/comment/{id}

Get edit issue meta

GET
/rest/api/2/issue/{issueIdOrKey}/editmeta

Notify

POST /rest/api/2/issue/{issueIdOrKey}/notify

Get remote issue links

GET
/rest/api/2/issue/{issueIdOrKey}/remotelink

Create or update remote issue link

POST
/rest/api/2/issue/{issueIdOrKey}/remotelink

Delete remote issue link by global id


DELETE
/rest/api/2/issue/{issueIdOrKey}/remotelink

Get remote issue link by id

GET
/rest/api/2/issue/{issueIdOrKey}/remotelink/{li
nkId}

Update remote issue link

PUT
/rest/api/2/issue/{issueIdOrKey}/remotelink/{li
nkId}

Delete remote issue link by id

DELETE
/rest/api/2/issue/{issueIdOrKey}/remotelink/{li
nkId}

Restore issue

PUT /rest/api/2/issue/{issueIdOrKey}/restore

Get transitions

GET
/rest/api/2/issue/{issueIdOrKey}/transitions

Do transition

POST
/rest/api/2/issue/{issueIdOrKey}/transitions

Remove vote
DELETE
/rest/api/2/issue/{issueIdOrKey}/votes

Add vote

POST /rest/api/2/issue/{issueIdOrKey}/votes

Get votes

GET /rest/api/2/issue/{issueIdOrKey}/votes

Get issue watchers

GET
/rest/api/2/issue/{issueIdOrKey}/watchers

Add watcher

POST
/rest/api/2/issue/{issueIdOrKey}/watchers

Remove watcher

DELETE
/rest/api/2/issue/{issueIdOrKey}/watchers

Get issue worklog

GET /rest/api/2/issue/{issueIdOrKey}/worklog

Add worklog

POST
/rest/api/2/issue/{issueIdOrKey}/worklog

Adds a new worklog entry to an issue.


Request

QUERY PARAMETERS

paramet ty description
er pe

adjustEst str (optional) allows you to provide specific instructions to update the remaining
imate in time estimate of the issue. Valid values are
g

● "new" - sets the estimate to a specific value


● "leave"- leaves the estimate as is
● "manual" - specify a specific amount to increase remaining estimate
by
● "auto"- Default option. Will automatically adjust the value based on
the new timeSpent specified on the worklog

newEsti str (required when "new" is selected for adjustEstimate) the new value for the
mate in remaining estimate field. e.g. "2d"
g

reduceBy str (required when "manual" is selected for adjustEstimate) the amount to reduce
in the remaining estimate by e.g. "2d"
g

EXAMPLE
{

"comment": "I did some work here.",

"visibility": {

"type": "group",

"value": "jira-developers"
},

"started": "2023-01-24T13:21:14.509+0000",

"timeSpentSeconds": 12000

SCHEMA

Responses

● STATUS 201Returned if add was successful


SCHEMA
● STATUS 400Returned if the input is invalid (e.g. missing required fields, invalid values, and so
forth).
● STATUS 403Returned if the calling user does not have permission to add the worklog

Get worklog

GET
/rest/api/2/issue/{issueIdOrKey}/worklog/{id}

Update worklog

PUT
/rest/api/2/issue/{issueIdOrKey}/worklog/{id}

Delete worklog

DELETE
/rest/api/2/issue/{issueIdOrKey}/worklog/{id}

Archive issues

POST /rest/api/2/issue/archive

Get create issue meta project issue types

GET
/rest/api/2/issue/createmeta/{projectIdOrKey}/
issuetypes

Get create issue meta fields

GET
/rest/api/2/issue/createmeta/{projectIdOrKey}/
issuetypes/{issueTypeId}

Get issue picker resource


GET /rest/api/2/issue/picker

api/2/issue/{issueIdOrKey}/attachmentsExpand all methods

Issue attachments

Add attachment

POST
/rest/api/2/issue/{issueIdOrKey}/attachments

api/2/issue/{issueIdOrKey}/propertiesExpand all methods

Get properties keys EXPERIMENTAL

GET
/rest/api/2/issue/{issueIdOrKey}/properties

Delete property EXPERIMENTAL

DELETE
/rest/api/2/issue/{issueIdOrKey}/properties/{pr
opertyKey}

Set property EXPERIMENTAL

PUT
/rest/api/2/issue/{issueIdOrKey}/properties/{pr
opertyKey}

Get property EXPERIMENTAL

GET
/rest/api/2/issue/{issueIdOrKey}/properties/{pr
opertyKey}
api/2/issue/{issueIdOrKey}/subtaskExpand all methods

Get sub tasks

GET /rest/api/2/issue/{issueIdOrKey}/subtask

Can move sub task

GET
/rest/api/2/issue/{issueIdOrKey}/subtask/mov
e

Move sub tasks

POST
/rest/api/2/issue/{issueIdOrKey}/subtask/mov
e

api/2/issueLinkExpand all methods

The Link Issue Resource provides functionality to manage issue links.

Link issues

POST /rest/api/2/issueLink

Get issue link

GET /rest/api/2/issueLink/{linkId}

Delete issue link

DELETE /rest/api/2/issueLink/{linkId}

api/2/issueLinkTypeExpand all methods


Rest resource to retrieve a list of issue link types.

Get issue link types

GET /rest/api/2/issueLinkType

Create issue link type

POST /rest/api/2/issueLinkType

Delete issue link type

DELETE
/rest/api/2/issueLinkType/{issueLinkTypeId}

Update issue link type

PUT
/rest/api/2/issueLinkType/{issueLinkTypeId}

Get issue link type

GET
/rest/api/2/issueLinkType/{issueLinkTypeId}

api/2/issuesecurityschemesExpand all methods

REST resource that allows to view security schemes defined in the product.

Get issue security schemes

GET /rest/api/2/issuesecurityschemes

Get issue security scheme

GET /rest/api/2/issuesecurityschemes/{id}
api/2/issuetypeExpand all methods

Create issue type

POST /rest/api/2/issuetype

Get issue all types

GET /rest/api/2/issuetype

Get issue type

GET /rest/api/2/issuetype/{id}

Delete issue type

DELETE /rest/api/2/issuetype/{id}

Update issue type

PUT /rest/api/2/issuetype/{id}

Get alternative issue types

GET /rest/api/2/issuetype/{id}/alternatives

Create avatar from temporary

POST /rest/api/2/issuetype/{id}/avatar

Store temporary avatar using multi part

POST
/rest/api/2/issuetype/{id}/avatar/temporary

Store temporary avatar


POST
/rest/api/2/issuetype/{id}/avatar/temporary

Get paginated issue types EXPERIMENTAL

GET /rest/api/2/issuetype/page

api/2/issuetype/{issueTypeId}/propertiesExpand all methods

This resource allows to store custom properties for issue types.

Get property keys EXPERIMENTAL

GET
/rest/api/2/issuetype/{issueTypeId}/properties

Delete property EXPERIMENTAL

DELETE
/rest/api/2/issuetype/{issueTypeId}/properties/
{propertyKey}

Set property EXPERIMENTAL

PUT
/rest/api/2/issuetype/{issueTypeId}/properties/
{propertyKey}

Get property EXPERIMENTAL

GET
/rest/api/2/issuetype/{issueTypeId}/properties/
{propertyKey}

api/2/issuetypeschemeExpand all methods


Resource for managing issue type schemes and their project associations.

An issue type scheme is a named, ordered collection of issue types that is associated with 0..n
projects. The contents of the associated issue type scheme determine which issue types are
available to a project.

As is the case with {@link IssueTypeResource#deleteIssueType(String, String) issue type deletion},


certain changes to an issue type scheme require issue migrations on the part of affected projects.
This resource does not support such migrations, and users are encouraged to use the GUI to
perform them when necessary.

Show more

Create issue type scheme

POST /rest/api/2/issuetypescheme

Get all issue type schemes

GET /rest/api/2/issuetypescheme

Get issue type scheme

GET /rest/api/2/issuetypescheme/{schemeId}

Update issue type scheme

PUT /rest/api/2/issuetypescheme/{schemeId}

Delete issue type scheme

DELETE
/rest/api/2/issuetypescheme/{schemeId}

Add project associations to scheme

POST
/rest/api/2/issuetypescheme/{schemeId}/asso
ciations
Get associated projects

GET
/rest/api/2/issuetypescheme/{schemeId}/asso
ciations

Set project associations for scheme

PUT
/rest/api/2/issuetypescheme/{schemeId}/asso
ciations

Remove all project associations

DELETE
/rest/api/2/issuetypescheme/{schemeId}/asso
ciations

Remove project association

DELETE
/rest/api/2/issuetypescheme/{schemeId}/asso
ciations/{projIdOrKey}

api/2/jql/autocompletedataExpand all methods

Resource for auto complete data for searches.

Get auto complete

GET /rest/api/2/jql/autocompleteda

You might also like