Going Stellar

Home/Jira fields reference

Jira Cloud fields and work types

Jira team-managed vs company-managed projects in the API

Most field administration endpoints in the REST API are documented for company-managed (classic) projects: contexts, screens, field configurations and work type schemes. Work types of team-managed projects carry a project scope. Every real request in this reference ran against a company-managed project, and the team-managed side below comes from the OpenAPI text.

Endpoints

MethodPathWhat it does
GET/rest/api/3/project/{projectId}/hierarchyReturns the work type hierarchy of a team-managed (next-gen) project.
GET/rest/api/3/issuetypescheme/projectReturns the scheme of classic projects only.
GET/rest/api/3/fieldconfigurationReturns field configurations used in company-managed projects.
GET/rest/api/3/field/searchReturns fields for classic projects, per the spec.

Examples

GET /rest/api/3/project/{projectId}/hierarchy

Asks for the hierarchy of the test project, which is company-managed. Jira answers 404 with a message that the project is not 'simplified'.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 404

{
 "errors": {},
 "errorMessages": [
  "Project with id: 10,100 is not simplified."
 ],
 "httpStatusCode": {
  "empty": false,
  "present": true
 }
}

Response headers

X-Ratelimit-Limit: 350
X-Ratelimit-Remaining: 349

Sent to Atlassian Cloud on .

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

The project object on a work item carries simplified false and projectTypeKey, the markers of a company-managed project.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'fields=priority,duedate,labels,components,fixVersions,environment,timetracking,reporter,status,resolution,issuetype,project,created,updated' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'fields': 'priority,duedate,labels,components,fixVersions,environment,timetracking,reporter,status,resolution,issuetype,project,created,updated'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "fields": {
  "project": {
   "key": "ZZREF",
   "projectTypeKey": "business",
   "simplified": false
  }
 }
}

Sent to Atlassian Cloud on .

GET /rest/api/3/issuetypescheme/project

The scheme lookup works because the project is company-managed.

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/issuetypescheme/project'

Python (requests)

import os
import requests

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

Response: HTTP 200

{
 "maxResults": 50,
 "startAt": 0,
 "total": 1,
 "isLast": true,
 "values": [
  {
   "issueTypeScheme": {
    "id": "10311",
    "name": "ZZREF: Task Management Issue Type Scheme",
    "description": "",
    "defaultIssueTypeId": "10117"
   },
   "projectIds": [
    "10100"
   ]
  }
 ]
}

Sent to Atlassian Cloud on .

GET /rest/api/3/fieldconfiguration

Field configurations answer the same way for classic projects.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

{
 "maxResults": 50,
 "startAt": 0,
 "total": 1,
 "isLast": true,
 "values": [
  {
   "id": 10000,
   "name": "Default Field Configuration",
   "description": "The default field configuration",
   "isDefault": true
  }
 ]
}

Sent to Atlassian Cloud on .

GET /rest/api/3/field/search

Field search with counts for contexts and projects, an administration view that the spec ties to classic projects.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'id=customfield_10164' \
  --data-urlencode 'expand=key,searcherKey,screensCount,contextsCount,projectsCount' \
  '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={'id': 'customfield_10164', 'expand': 'key,searcherKey,screensCount,contextsCount,projectsCount'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "values": [
  {
   "id": "customfield_10164",
   "contextsCount": 2,
   "projectsCount": 2
  }
 ]
}

Sent to Atlassian Cloud on .

How it behaves

  • The hierarchy endpoint answered 404 with errorMessages ['Project with id: 10,100 is not simplified.'] for the company-managed project.
  • On a work item, project.simplified was false and projectTypeKey was 'business'.
  • The custom fields in these pages could be set because the project is company-managed: they were added to its screen and given a context. No run exists on a team-managed project.
  • Scheme, field configuration and screen scheme endpoints returned data for the project; the spec says they cover classic projects only.

Where the documentation differs

  • GET /rest/api/3/project/{projectId}/hierarchy

    Sent to Atlassian Cloud, . The documentation: The 404 response is described as 'Returned if the project is not found or the user does not have the necessary permission.'

    What happened: The project exists and is visible to the caller, yet the call answered 404 with 'Project with id: 10,100 is not simplified.', so a 404 can also mean a company-managed project.

Pitfalls

  • Do not read a 404 from the hierarchy endpoint as a missing project; check the project's simplified flag first.
  • The spec text for field search says 'fields for Classic Jira projects', so a tool built on contexts and screens will not see team-managed project fields.
  • On create, the spec says that in a next-gen project any work item may be a child when parent and child are in the same project, which differs from the fixed hierarchy of a classic project.
  • Work types with a scope hold a project id; the spec describes that scope as the next-gen projects the work type is available in.

Questions and answers

How can I tell if a project is team-managed?

The project object has a simplified flag; true means team-managed. The hierarchy endpoint answers only for such projects.

Do the context and screen endpoints work for team-managed projects?

The spec scopes them to classic projects. No request against a team-managed project was run for this reference.

Sources

  1. Projects (Jira REST API v3)
  2. Issue type schemes (Jira REST API v3)
  3. Field configurations (Jira REST API v3)

Markdown version · All Jira fields pages