Going Stellar

Home/Jira fields reference

Jira Cloud fields and work types

Create a Jira custom field: type and searcher keys

POST /rest/api/3/field creates a custom field from a name, a full type key and, for anything you want to search with JQL, a matching searcher key, and answers 201 with the new field's id, key, clauseNames and schema. A bad type and a bad searcher each have their own 400 body. A single field cannot be fetched with GET on its id, so reading it back goes through the search endpoint.

Endpoints

MethodPathWhat it does
POST/rest/api/3/fieldCreates a custom field from name, description, type and searcherKey.
GET/rest/api/3/field/searchReads a field back by id, with the type display name and searcher key.
GET/rest/api/3/fieldLists every system and custom field the caller can see.

Examples

POST /rest/api/3/field

Creates a single-line text field with the text searcher. The 201 body is the field itself, with the id to use everywhere else and the JQL names.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref created in probe",
  "type": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
  "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher",
  "description": "Example field."
}' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref created in probe',
          'type': 'com.atlassian.jira.plugin.system.customfieldtypes:textfield',
          'searcherKey': 'com.atlassian.jira.plugin.system.customfieldtypes:textsearcher',
          'description': 'Example field.'},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "customfield_10222",
 "key": "customfield_10222",
 "name": "zz-ref created in probe",
 "untranslatedName": "zz-ref created in probe",
 "custom": true,
 "orderable": true,
 "navigable": true,
 "searchable": true,
 "clauseNames": [
  "zz-ref created in probe[Short text]",
  "cf[10222]",
  "zz-ref created in probe"
 ],
 "schema": {
  "type": "string",
  "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
  "customId": 10222
 }
}

Response headers

Content-Type: application/json;charset=UTF-8
X-Ratelimit-Limit: 200

Sent to Atlassian Cloud on .

POST /rest/api/3/field

Creates the same type without searcherKey. Jira still answers 201 and the body shows searchable true.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref no searcher",
  "type": "com.atlassian.jira.plugin.system.customfieldtypes:textfield"
}' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref no searcher',
          'type': 'com.atlassian.jira.plugin.system.customfieldtypes:textfield'},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "customfield_10223",
 "name": "zz-ref no searcher",
 "custom": true,
 "searchable": true,
 "clauseNames": [
  "zz-ref no searcher[Short text]",
  "zz-ref no searcher",
  "cf[10223]"
 ],
 "schema": {
  "type": "string",
  "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
  "customId": 10223
 }
}

Sent to Atlassian Cloud on .

POST /rest/api/3/field

Creates a field with a type key that does not exist. Jira answers 400 with a plain message and creates nothing.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref bad",
  "type": "com.atlassian.jira.plugin.system.customfieldtypes:nosuchtype"
}' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref bad',
          'type': 'com.atlassian.jira.plugin.system.customfieldtypes:nosuchtype'},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [
  "Invalid field type specified."
 ],
 "errors": {}
}

Sent to Atlassian Cloud on .

POST /rest/api/3/field

Pairs a single-line text type with the date range searcher. The error is keyed on searcher, so it is easy to tell from a bad type.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref badsearch",
  "type": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
  "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:daterange"
}' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref badsearch',
          'type': 'com.atlassian.jira.plugin.system.customfieldtypes:textfield',
          'searcherKey': 'com.atlassian.jira.plugin.system.customfieldtypes:daterange'},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [],
 "errors": {
  "searcher": "Invalid searcher chosen"
 }
}

Sent to Atlassian Cloud on .

POST /rest/api/3/field

Creates a multiple group picker with multiselectsearcher, the searcher the spec table lists for that type. Jira refuses it.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "zz-ref multigroup doc searcher",
  "type": "com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker",
  "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
}' \
  'https://your-domain.atlassian.net/rest/api/3/field'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/field',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'name': 'zz-ref multigroup doc searcher',
          'type': 'com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker',
          'searcherKey': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher'},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [],
 "errors": {
  "searcher": "Invalid searcher chosen"
 }
}

Sent to Atlassian Cloud on .

GET /rest/api/3/field/search

Lists the 20 custom fields in one call with expand=key,lastUsed,screensCount,contextsCount,isLocked,searcherKey. Each row gives the type key under schema.custom and its searcherKey, which is the quickest way to see which pair Jira holds for a type.

curl

curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'type=custom' \
  --data-urlencode 'query=zz-ref' \
  --data-urlencode 'expand=key,lastUsed,screensCount,contextsCount,isLocked,searcherKey' \
  --data-urlencode 'maxResults=50' \
  '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',
 'query': 'zz-ref',
 'expand': 'key,lastUsed,screensCount,contextsCount,isLocked,searcherKey',
 'maxResults': '50'},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "total": 20,
 "values": [
  {
   "name": "zz-ref cascading",
   "schema": {
    "type": "option-with-child",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect"
   },
   "typeDisplayName": "Select List (cascading)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher"
  },
  {
   "name": "zz-ref checkboxes",
   "schema": {
    "type": "array",
    "items": "option",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes"
   },
   "typeDisplayName": "Checkboxes",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
  },
  {
   "name": "zz-ref date",
   "schema": {
    "type": "date",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:datepicker"
   },
   "typeDisplayName": "Date Picker",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:daterange"
  },
  {
   "name": "zz-ref datetime",
   "schema": {
    "type": "datetime",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:datetime"
   },
   "typeDisplayName": "Date Time Picker",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange"
  },
  {
   "name": "zz-ref group",
   "schema": {
    "type": "group",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:grouppicker"
   },
   "typeDisplayName": "Group Picker (single group)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher"
  },
  {
   "name": "zz-ref labels",
   "schema": {
    "type": "array",
    "items": "string",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:labels"
   },
   "typeDisplayName": "Labels",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher"
  },
  {
   "name": "zz-ref multigroup",
   "schema": {
    "type": "array",
    "items": "group",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker"
   },
   "typeDisplayName": "Group Picker (multiple groups)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher"
  },
  {
   "name": "zz-ref multiselect",
   "schema": {
    "type": "array",
    "items": "option",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiselect"
   },
   "typeDisplayName": "Select List (multiple choices)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
  },
  {
   "name": "zz-ref multiuser",
   "schema": {
    "type": "array",
    "items": "user",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker"
   },
   "typeDisplayName": "User Picker (multiple users)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher"
  },
  {
   "name": "zz-ref multiversion",
   "schema": {
    "type": "array",
    "items": "version",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiversion"
   },
   "typeDisplayName": "Version Picker (multiple versions)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher"
  },
  {
   "name": "zz-ref number",
   "schema": {
    "type": "number",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:float"
   },
   "typeDisplayName": "Number Field",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:exactnumber"
  },
  {
   "name": "zz-ref paragraph",
   "schema": {
    "type": "string",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textarea"
   },
   "typeDisplayName": "Paragraph (supports rich text)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher"
  },
  {
   "name": "zz-ref project",
   "schema": {
    "type": "project",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:project"
   },
   "typeDisplayName": "Project Picker (single project)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher"
  },
  {
   "name": "zz-ref radio",
   "schema": {
    "type": "option",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons"
   },
   "typeDisplayName": "Radio Buttons",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
  },
  {
   "name": "zz-ref readonly",
   "schema": {
    "type": "string",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield"
   },
   "typeDisplayName": "Text Field (read only)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher"
  },
  {
   "name": "zz-ref select",
   "schema": {
    "type": "option",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select"
   },
   "typeDisplayName": "Select List (single choice)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
  },
  {
   "name": "zz-ref text",
   "schema": {
    "type": "string",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield"
   },
   "typeDisplayName": "Short text (plain text only)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher"
  },
  {
   "name": "zz-ref url",
   "schema": {
    "type": "string",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:url"
   },
   "typeDisplayName": "URL Field",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher"
  },
  {
   "name": "zz-ref user",
   "schema": {
    "type": "user",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:userpicker"
   },
   "typeDisplayName": "User Picker (single user)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher"
  },
  {
   "name": "zz-ref version",
   "schema": {
    "type": "version",
    "custom": "com.atlassian.jira.plugin.system.customfieldtypes:version"
   },
   "typeDisplayName": "Version Picker (single version)",
   "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher"
  }
 ]
}

Response headers

X-Ratelimit-Limit: 350

Sent to Atlassian Cloud on .

GET /rest/api/3/field/customfield_10162

GET on /rest/api/3/field/{id} is not an operation. The answer is a 405 problem document, not a field.

curl

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

Python (requests)

import os
import requests

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

Response: HTTP 405

{
 "type": "about:blank",
 "title": "Method Not Allowed",
 "status": 405,
 "detail": "Method 'GET' is not supported.",
 "instance": "/rest/api/3/field/customfield_10162"
}

Sent to Atlassian Cloud on .

How it behaves

  • The type key is the plugin prefix com.atlassian.jira.plugin.system.customfieldtypes: followed by a short name, and the searcher key uses the same prefix. The pairs read back from the field list are: textfield and textarea with textsearcher; select, multiselect, radiobuttons and multicheckboxes with multiselectsearcher; cascadingselect with cascadingselectsearcher; datepicker with daterange; datetime with datetimerange; float with exactnumber; url with exacttextsearcher; userpicker and multiuserpicker with userpickergroupsearcher; grouppicker and multigrouppicker with grouppickersearcher; labels with labelsearcher; project with projectsearcher; version and multiversion with versionsearcher; readonlyfield with textsearcher.
  • An unknown type key gives 400 with errorMessages ['Invalid field type specified.'], and a searcher that does not suit the type gives 400 with errors.searcher = 'Invalid searcher chosen'. The spec table pairs multigrouppicker with multiselectsearcher, and that exact pair got the same 400, while the field list shows grouppickersearcher on a multiple group field.
  • A successful create answered 201 with id and key (customfield_10222), name, untranslatedName, custom, orderable, navigable, searchable, clauseNames and schema. For the text field the clauseNames were the name with a type suffix ('... [Short text]'), cf[10222] and the plain name.
  • A text field created without searcherKey also answered 201, with searchable true and its clauseNames.
  • GET /rest/api/3/field/{id} answers 405 as application/problem+json. The create calls drew from a bucket of 200 requests, the field search from 350.

Where the documentation differs

  • POST /rest/api/3/field

    Sent to Atlassian Cloud, . The documentation: The request schema pairs multigrouppicker with multiselectsearcher ('multigrouppicker: multiselectsearcher').

    What happened: Creating a multiple group picker with exactly that searcher gave 400 'Invalid searcher chosen'. The field that does exist carries grouppickersearcher.

  • POST /rest/api/3/field

    Sent to Atlassian Cloud, . The documentation: The spec says: "If no searcher is provided, the field isn't searchable."

    What happened: A text field created without searcherKey answered 201 with searchable true and a clauseNames list in the body.

Pitfalls

  • Leave searcherKey out and the spec says the field is not searchable, yet the 201 body showed searchable true. Run a JQL clause on the new field before relying on either statement.
  • The type key is the full prefixed string, not 'select' or 'textfield' alone; a short name is an unknown type and fails with the type error.
  • The edit metadata rules in the spec require a screen and a valid context before a field can be set, so check both after creating a field.
  • Names do not have to be unique. Store the returned customfield id, not the name.

Questions and answers

Which searcher key goes with which custom field type?

The OpenAPI schema for CustomFieldDefinitionJsonBean lists the valid searchers per type, and the search endpoint shows what the field really carries. Radio buttons, checkboxes, single and multiple selects all use multiselectsearcher; text and paragraph fields use textsearcher.

How do I read a single field back after creating it?

GET /rest/api/3/field/{id} answers 405. Call GET /rest/api/3/field/search with id set to the customfield id.

Sources

  1. Issue fields (Jira REST API v3)

Markdown version · All Jira fields pages