Going Stellar

Home/Atlassian REST API reference

Jira and Confluence Cloud REST API

Jira project statuses, components and versions via REST

GET /rest/api/3/project/{projectIdOrKey}/statuses returns the statuses of a project grouped by work type. The components and versions endpoints return plain arrays. GET /rest/api/3/statuses/search returns the same statuses in a paged envelope, with a different shape for the category.

Endpoints

MethodPathWhat it does
GET/rest/api/3/project/{projectIdOrKey}/statusesReturns statuses per work type for a project.
GET/rest/api/3/project/{projectIdOrKey}/componentsLists the components of a project.
GET/rest/api/3/project/{projectIdOrKey}/versionsLists the versions of a project.
GET/rest/api/3/statuses/searchSearches statuses, optionally for one project.

Examples

GET /rest/api/3/project/WEB/statuses

Reads the statuses of WEB. One entry per work type, each with its statuses.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

[
 {
  "id": "10079",
  "name": "Epic",
  "subtask": false,
  "statuses": [
   {
    "name": "Done",
    "id": "10072",
    "statusCategory": {
     "key": "done",
     "name": "Done"
    },
    "scope": {
     "type": "PROJECT",
     "project": {
      "id": "10066"
     }
    }
   },
   {
    "name": "To Do",
    "id": "10073",
    "statusCategory": {
     "key": "new",
     "name": "To Do"
    },
    "scope": {
     "type": "PROJECT",
     "project": {
      "id": "10066"
     }
    }
   }
  ]
 },
 {
  "id": "10080",
  "name": "Subtask",
  "subtask": true,
  "statuses": [
   {
    "name": "Done",
    "id": "10072",
    "statusCategory": {
     "key": "done",
     "name": "Done"
    },
    "scope": {
     "type": "PROJECT",
     "project": {
      "id": "10066"
     }
    }
   },
   {
    "name": "To Do",
    "id": "10073",
    "statusCategory": {
     "key": "new",
     "name": "To Do"
    },
    "scope": {
     "type": "PROJECT",
     "project": {
      "id": "10066"
     }
    }
   }
  ]
 }
]

Response headers

X-Ratelimit-Limit: 350

Sent to Atlassian Cloud on .

GET /rest/api/3/project/WEB/components

A project without components. The answer is an empty array.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

[]

Sent to Atlassian Cloud on .

GET /rest/api/3/project/WEB/versions

A project without versions. Also an empty array.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

[]

Sent to Atlassian Cloud on .

Searches the statuses of one project by projectId, five per page.

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

{
 "startAt": 0,
 "total": 4,
 "isLast": true,
 "maxResults": 5,
 "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

  • project/statuses returned an array with one object per work type (id, name, subtask, statuses). The same status objects repeat under each work type that uses them.
  • Each status in that listing has a statusCategory object with a lowercase key such as done or new, plus a scope of type PROJECT with the project id.
  • statuses/search wrote statusCategory as an uppercase string, for example DONE, instead of an object.
  • Components and versions for a project that has none returned 200 with [], not an error.

Pitfalls

  • Do not assume one status list per project. The status set belongs to the work type, so group before you display.
  • Compare statusCategory by key in one endpoint and by string in the other. The two shapes do not match.
  • The components and versions calls return arrays without paging fields, so read the whole array in one response.

Questions and answers

Why does statusCategory look different between two status endpoints?

project/statuses nests an object with id, key, colorName and name, while statuses/search returns the upper-case category name as a string.

Sources

  1. The Jira Cloud platform REST API v3 (Atlassian Developer)
  2. Get all statuses for project (Jira REST API v3)

Markdown version · All REST API pages