Going Stellar

Home/Atlassian REST API reference

Jira and Confluence Cloud REST API

Jira fields, work types, priorities and statuses via REST

The configuration lists are separate read endpoints: /field, /field/search, /issuetype, /issuetype/project, /priority/search, /resolution/search and /statuses/search. Some return bare arrays and some a paged envelope with values, so the shape has to be checked per endpoint.

Endpoints

MethodPathWhat it does
GET/rest/api/3/fieldReturns all system and custom fields as an array.
GET/rest/api/3/field/searchSearches fields, paged.
GET/rest/api/3/issuetypeReturns all work types visible to the user.
GET/rest/api/3/issuetype/projectReturns the work types of one project.
GET/rest/api/3/priority/searchReturns priorities, paged.
GET/rest/api/3/resolution/searchReturns resolutions, paged.
GET/rest/api/3/statuses/searchReturns statuses, paged.

Examples

GET /rest/api/3/field

Lists every field as a bare array. The first entries show system fields with clauseNames and schema.

curl

curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)

Response: HTTP 200

[
 {
  "id": "statuscategorychangedate",
  "name": "Status category changed",
  "custom": false,
  "orderable": false,
  "navigable": true,
  "searchable": true,
  "clauseNames": [
   "statusCategoryChangedDate"
  ],
  "schema": {
   "type": "datetime",
   "system": "statuscategorychangedate"
  }
 },
 {
  "id": "issuetype",
  "name": "Issue Type",
  "custom": false,
  "orderable": true,
  "navigable": true,
  "searchable": true,
  "clauseNames": [
   "issuetype",
   "type",
   "worktype"
  ],
  "schema": {
   "type": "issuetype",
   "system": "issuetype"
  }
 }
]

Response headers

X-Ratelimit-Limit: 350

Sent to Atlassian Cloud on .

Searches only custom fields, three per page.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'type=custom' \
  --data-urlencode 'maxResults=3' \
  'https://your-domain.atlassian.net/rest/api/3/field/search'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/field/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'type': 'custom', 'maxResults': '3'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "maxResults": 3,
 "total": 46,
 "isLast": false,
 "values": [
  {
   "id": "customfield_10026",
   "name": "[CHART] Date of First Response",
   "schema": {
    "type": "datetime",
    "custom": "com.atlassian.jira.ext.charting:firstresponsedate",
    "customId": 10026
   },
   "typeDisplayName": "Date of First Response"
  },
  {
   "id": "customfield_10027",
   "name": "[CHART] Time in Status",
   "schema": {
    "type": "any",
    "custom": "com.atlassian.jira.ext.charting:timeinstatus",
    "customId": 10027
   },
   "typeDisplayName": "Time in Status"
  }
 ]
}

Sent to Atlassian Cloud on .

GET /rest/api/3/issuetype

Lists all work types, including those scoped to a single project.

curl

curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/issuetype'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issuetype',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)

Response: HTTP 200

[
 {
  "id": "10118",
  "name": "Sub-task",
  "subtask": true,
  "hierarchyLevel": -1
 },
 {
  "id": "10002",
  "name": "Subtask",
  "subtask": true,
  "hierarchyLevel": -1,
  "scope": {
   "type": "PROJECT",
   "project": {
    "id": "10000"
   }
  }
 }
]

Sent to Atlassian Cloud on .

GET /rest/api/3/issuetype/project

Lists the work types of project WEB by projectId.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'projectId={projectId}' \
  'https://your-domain.atlassian.net/rest/api/3/issuetype/project'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issuetype/project',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'projectId': '{projectId}'},
)
print(r.status_code, r.text)

Response: HTTP 200

[
 {
  "id": "10079",
  "name": "Epic",
  "subtask": false,
  "hierarchyLevel": 1,
  "scope": {
   "type": "PROJECT",
   "project": {
    "id": "10066"
   }
  }
 },
 {
  "id": "10080",
  "name": "Subtask",
  "subtask": true,
  "hierarchyLevel": -1,
  "scope": {
   "type": "PROJECT",
   "project": {
    "id": "10066"
   }
  }
 }
]

Sent to Atlassian Cloud on .

GET /rest/api/3/priority/search

Lists priorities in a paged envelope with an isDefault flag.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'maxResults=5' \
  'https://your-domain.atlassian.net/rest/api/3/priority/search'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/priority/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'maxResults': '5'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "total": 5,
 "isLast": true,
 "values": [
  {
   "statusColor": "#d04437",
   "name": "Highest",
   "id": "1",
   "isDefault": false
  },
  {
   "statusColor": "#f15C75",
   "name": "High",
   "id": "2",
   "isDefault": false
  }
 ]
}

Sent to Atlassian Cloud on .

GET /rest/api/3/resolution/search

Lists the resolutions.

curl

curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/resolution/search'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/resolution/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "total": 4,
 "isLast": true,
 "values": [
  {
   "id": "10000",
   "description": "Work has been completed on this work item.",
   "name": "Done",
   "isDefault": false
  },
  {
   "id": "10033",
   "description": "This issue won't be actioned.",
   "name": "Won't Do",
   "isDefault": false
  }
 ]
}

Sent to Atlassian Cloud on .

Lists statuses of one project.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'projectId={projectId}' \
  --data-urlencode 'maxResults=5' \
  'https://your-domain.atlassian.net/rest/api/3/statuses/search'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/statuses/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'projectId': '{projectId}', 'maxResults': '5'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "total": 4,
 "isLast": true,
 "values": [
  {
   "id": "10072",
   "name": "Done",
   "statusCategory": "DONE",
   "scope": {
    "type": "PROJECT",
    "project": {
     "id": "10066"
    }
   }
  },
  {
   "id": "10074",
   "name": "In Progress",
   "statusCategory": "IN_PROGRESS",
   "scope": {
    "type": "PROJECT",
    "project": {
     "id": "10066"
    }
   }
  }
 ]
}

Sent to Atlassian Cloud on .

How it behaves

  • GET /field returned a bare array of 89 fields. GET /field/search with type=custom returned an envelope with total 46 and the entries under values.
  • Custom field ids look like customfield_10026. The field names on this instance include some added by an installed app, so the same call on another site returns a different list.
  • GET /issuetype returned 24 work types. Team-managed projects add their own, so entries can carry a scope object with the project id, and the same name can appear more than once.
  • issuetype/project?projectId returned only the work types of that project, each with scope.type PROJECT.
  • priority/search and resolution/search both use the envelope startAt, maxResults, total, isLast and values.

Pitfalls

  • Choose between /field and /field/search by whether you need paging or filters. The first has no paging fields.
  • Match work types by id, not by name. A name such as Subtask can exist globally and again scoped to a project.
  • Never hard-code customfield_ ids across sites. The id for one meaning differs by instance.
  • A priority marked isDefault is a hint for creating items. It does not say which priority an existing item has.

Questions and answers

How do I find the id of a custom field?

List GET /rest/api/3/field/search with type=custom and read the id for the name you need, for example customfield_10026.

Sources

  1. The Jira Cloud platform REST API v3 (Atlassian Developer)
  2. Get fields paginated (Jira REST API v3)

Markdown version · All REST API pages