Going Stellar

Home/Jira fields reference

Jira Cloud fields and work types

Jira number custom field: set, read and search via API

The number field takes a JSON number. A numeric string is refused in the same way as text. The field is found in JQL with comparison operators, by display name or by its customfield id.

Endpoints

MethodPathWhat it does
PUT/rest/api/3/issue/{issueIdOrKey}Sets or changes the value.
GET/rest/api/3/issue/{issueIdOrKey}Reads the stored value.
POST/rest/api/3/issueCreates a work item with values.
POST/rest/api/3/search/jqlFinds work items by value.

Examples

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

Writes 3.5 and reads the number back.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "customfield_10171": 3.5
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'returnIssue': 'true', 'fields': 'customfield_10171'},
    json={'fields': {'customfield_10171': 3.5}},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "key": "ZZREF-6",
 "fields": {
  "customfield_10171": 3.5
 }
}

Sent to Atlassian Cloud on .

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

The string "3.5" is rejected even though it is numeric.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "customfield_10171": "3.5"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'returnIssue': 'true', 'fields': 'customfield_10171'},
    json={'fields': {'customfield_10171': '3.5'}},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [],
 "errors": {
  "customfield_10171": "Specify a number for the custom field (below 100,000,000,000,000)"
 }
}

Sent to Atlassian Cloud on .

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

Text gives the same message.

curl

curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "customfield_10171": "three"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=customfield_10171',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'returnIssue': 'true', 'fields': 'customfield_10171'},
    json={'fields': {'customfield_10171': 'three'}},
)
print(r.status_code, r.text)

Response: HTTP 400

{
 "errorMessages": [],
 "errors": {
  "customfield_10171": "Specify a number for the custom field (below 100,000,000,000,000)"
 }
}

Sent to Atlassian Cloud on .

POST /rest/api/3/issue

Sets a number at create time next to other custom fields.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "project": {
      "key": "ZZREF"
    },
    "issuetype": {
      "name": "Task"
    },
    "summary": "Created with custom fields",
    "customfield_10162": "on create",
    "customfield_10164": {
      "value": "Blue"
    },
    "customfield_10171": 7,
    "customfield_10169": "2026-12-01"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'project': {'key': 'ZZREF'},
                     'issuetype': {'name': 'Task'},
                     'summary': 'Created with custom fields',
                     'customfield_10162': 'on create',
                     'customfield_10164': {'value': 'Blue'},
                     'customfield_10171': 7,
                     'customfield_10169': '2026-12-01'}},
)
print(r.status_code, r.text)

Response: HTTP 201

{
 "id": "10789",
 "key": "ZZREF-10",
 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10789"
}

Sent to Atlassian Cloud on .

POST /rest/api/3/search/jql

Compares the field with a number using the > operator.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "jql": "project = ZZREF AND \"zz-ref number\" > 3",
  "fields": [
    "summary"
  ],
  "maxResults": 2
}' \
  'https://your-domain.atlassian.net/rest/api/3/search/jql'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/search/jql',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'jql': 'project = ZZREF AND "zz-ref number" > 3', 'fields': ['summary'], 'maxResults': 2},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "issues": [
  {
   "key": "ZZREF-10"
  },
  {
   "key": "ZZREF-6"
  }
 ],
 "isLast": true
}

Sent to Atlassian Cloud on .

POST /rest/api/3/search/jql

The customfield id works as the JQL field name.

curl

curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "jql": "project = ZZREF AND customfield_10171 = 3.5",
  "fields": [
    "summary"
  ],
  "maxResults": 2
}' \
  'https://your-domain.atlassian.net/rest/api/3/search/jql'

Python (requests)

import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/search/jql',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'jql': 'project = ZZREF AND customfield_10171 = 3.5',
          'fields': ['summary'],
          'maxResults': 2},
)
print(r.status_code, r.text)

Response: HTTP 200

{
 "issues": [
  {
   "key": "ZZREF-6"
  }
 ],
 "isLast": true
}

Sent to Atlassian Cloud on .

How it behaves

  • Type key com.atlassian.jira.plugin.system.customfieldtypes:float, searcher key com.atlassian.jira.plugin.system.customfieldtypes:exactnumber, schema type number, display name "Number Field".
  • 3.5 answered 200 and read back as 3.5.
  • "3.5" and "three" both gave 400 "Specify a number for the custom field (below 100,000,000,000,000)".
  • The value 7 was stored through the create call, and a > 3 filter returned both work items that held a value above 3.

Pitfalls

  • Quoted numbers from a spreadsheet or form fail; convert them before the request.
  • The message states an upper bound of 100,000,000,000,000, so very large values need a different field type.
  • The searcher is exactnumber, but comparison operators such as > worked in the run.

Questions and answers

Can I send a number as a string?

No. A numeric string was refused with a 400 asking for a number.

Sources

  1. Issues (Jira REST API v3)
  2. Issue fields (Jira REST API v3)
  3. Issue search (Jira REST API v3)

Markdown version · All Jira fields pages