Going Stellar

Home/Jira fields reference

Jira Cloud fields and work types

Jira custom field contexts: list, projects and types

A context decides in which projects and for which work types a custom field exists, and options and defaults hang off the context, not the field. GET /rest/api/3/field/{fieldId}/context lists contexts, POST creates one, PUT renames it or sets its work types, and DELETE removes it. Two contexts of one field cannot cover the same project and work types.

Endpoints

MethodPathWhat it does
GET/rest/api/3/field/{fieldId}/contextLists the contexts of a custom field, filterable by isAnyIssueType and isGlobalContext.
POST/rest/api/3/field/{fieldId}/contextCreates a context from name, projectIds and issueTypeIds.
PUT/rest/api/3/field/{fieldId}/context/{contextId}Updates the name and description of a context.
PUT/rest/api/3/field/{fieldId}/context/{contextId}/issuetypeAdds work types to a context.
DELETE/rest/api/3/field/{fieldId}/context/{contextId}Deletes a context.
GET/rest/api/3/field/{fieldId}/context/projectmappingMaps each context to the projects it applies to.

Examples

GET /rest/api/3/field/customfield_10222/context

A field created a moment earlier has one context, the global one Jira generated.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

{
 "total": 1,
 "values": [
  {
   "id": "10453",
   "description": "Default configuration scheme generated by Jira",
   "isGlobalContext": true,
   "isAnyIssueType": true
  }
 ]
}

Sent to Atlassian Cloud on .

POST /rest/api/3/field/customfield_10222/context

Creates a context for one project and all work types. The 201 body repeats name, projectIds and issueTypeIds and adds the id.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref project context",
  "projectIds": [
    "{projectId}"
  ],
  "issueTypeIds": []
}' \
  'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref project context', 'projectIds': ['{projectId}'], 'issueTypeIds': []},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "10455",
 "name": "zz-ref project context",
 "projectIds": [
  "10100"
 ],
 "issueTypeIds": []
}

Response headers

X-Ratelimit-Limit: 200

Sent to Atlassian Cloud on .

POST /rest/api/3/field/customfield_10222/context

A second context for the same project and all work types is refused with 400 and a message naming the context it clashes with.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref second context",
  "projectIds": [
    "{projectId}"
  ],
  "issueTypeIds": []
}' \
  'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref second context', 'projectIds': ['{projectId}'], 'issueTypeIds': []},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [
  "Conflict between context 10455 and new context: both cover projects [10100] for all issue types."
 ],
 "errors": {}
}

Sent to Atlassian Cloud on .

PUT /rest/api/3/field/customfield_10222/context/10455

Renames the context and sets a description. The answer is 204 with no body.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref project context renamed",
  "description": "Renamed."
}' \
  'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context/10455'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context/10455',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref project context renamed', 'description': 'Renamed.'},
)
print(r.status_code, r.text)

Response: HTTP 204

No response body.

Sent to Atlassian Cloud on .

PUT /rest/api/3/field/customfield_10222/context/10455/issuetype

Restricts the context to one work type. Again 204 with no body.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "issueTypeIds": [
    "{issueTypeId}"
  ]
}' \
  'https://your-domain.atlassian.net/rest/api/3/field/customfield_10222/context/10455/issuetype'

Python (requests)

import os
import requests

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

Response: HTTP 204

No response body.

Sent to Atlassian Cloud on .

GET /rest/api/3/field/customfield_10222/context

Lists the contexts again. The project context now has the new name and description, isGlobalContext false and isAnyIssueType false.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 200

{
 "total": 2,
 "values": [
  {
   "id": "10453",
   "name": "Default Configuration Scheme for zz-ref created in probe",
   "description": "Default configuration scheme generated by Jira",
   "isGlobalContext": true,
   "isAnyIssueType": true
  }
 ]
}

Sent to Atlassian Cloud on .

DELETE /rest/api/3/field/customfield_10222/context/10455

Deletes the project context. 204 with no body.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 204

No response body.

Response headers

X-Ratelimit-Limit: 400

Sent to Atlassian Cloud on .

How it behaves

  • A new field starts with one context, a global one whose description is the default configuration scheme generated by Jira. Each of the 20 older test fields also had a second context tied to the project (contextsCount 2).
  • POST answered 201 with {id, name, projectIds, issueTypeIds}. An empty issueTypeIds list means all work types.
  • A second POST for the same project and all work types answered 400 with errorMessages ['Conflict between context 10455 and new context: both cover projects [10100] for all issue types.'].
  • PUT on the context and PUT on its issuetype endpoint answered 204 each. Afterwards the listing showed the new name, the description 'Renamed.', isAnyIssueType false and isGlobalContext false.
  • In the project mapping the global context has isGlobalContext true and no projectId; a project-bound context has projectId.

Pitfalls

  • The spec says the same project can appear under several contexts on sites where multiple contexts per project are enabled (CHANGE-3082), so never assume one mapping row per project. The conflict in the run was about identical project and work type coverage.
  • From April 2026 the spec says deleting the global context, or adding projects to it, is rejected with 400 (CHANGE-3019). The delete that was run targeted a project context, so the global case comes from the documentation only.
  • Assigning a context to projects also fails if any project is already assigned to a context of that field (spec text); check projectmapping first.
  • Option lists and default values are per context. Pick the right contextId before reading or writing either.

Questions and answers

What is the global context of a custom field?

It is the context with isGlobalContext true that applies to every project. Jira generates it when the field is created, and the project mapping lists it without a projectId.

How do I see which projects a field applies to?

Call GET /rest/api/3/field/{fieldId}/context/projectmapping and read projectId on each row; a row with isGlobalContext true means all projects.

Sources

  1. Issue custom field contexts (Jira REST API v3)

Markdown version · All Jira fields pages