# Jira priority field: set by name and read back

URL: https://goingstellar.ro/reference/jira-fields/priority-field/

priority is a single-choice system field. It is set with an object that names the priority, and it reads back as an object with self, iconUrl, name and id. A name that is not in the site's priority list answers 400 with a message that talks about the string format.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| PUT | `/rest/api/3/issue/{issueIdOrKey}` | Sets fields.priority by name or id. |
| POST | `/rest/api/3/issue` | Accepts fields.priority by id on create. |
| GET | `/rest/api/3/issue/{issueIdOrKey}` | Returns fields.priority as an object. |
| GET | `/rest/api/3/issue/{issueIdOrKey}/editmeta` | Lists allowedValues for the priority field. |
| GET | `/rest/api/3/priority/search` | Lists the priorities of the site. |

## Examples

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

Sets the priority to High and asks for the edited field in the response.

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

```python
import os
import requests

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

Response: HTTP 200

```
{
 "key": "ZZREF-6",
 "fields": {
  "priority": {
   "self": "https://your-domain.atlassian.net/rest/api/3/priority/2",
   "iconUrl": "https://your-domain.atlassian.net/images/icons/priorities/high_new.svg",
   "name": "High",
   "id": "2"
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

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

Sends a priority name that does not exist.

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

```python
import os
import requests

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

Response: HTTP 400

```
{
 "errorMessages": [],
 "errors": {
  "priority": "Specify the Priority (name) in the string format"
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

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

The edit metadata lists the choices the caller may set, with ids.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/editmeta'
```

```python
import os
import requests

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

Response: HTTP 200

```
{
 "fields": {
  "priority": {
   "required": false,
   "schema": {
    "type": "priority",
    "system": "priority"
   },
   "name": "Priority",
   "operations": [
    "set"
   ],
   "allowedValues": [
    {
     "id": "1",
     "name": "Highest"
    },
    {
     "id": "2",
     "name": "High"
    },
    {
     "id": "3",
     "name": "Medium"
    }
   ]
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

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

Reads the priority alongside other system fields, as part of an ordinary GET.

```bash
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
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

```
{
 "key": "ZZREF-6",
 "fields": {
  "priority": {
   "self": "https://your-domain.atlassian.net/rest/api/3/priority/2",
   "iconUrl": "https://your-domain.atlassian.net/images/icons/priorities/high_new.svg",
   "name": "High",
   "id": "2"
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/3/priority/search

Lists the priorities of the site, with ids, names and the default flag.

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

```python
import os
import requests

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

Response: HTTP 200

```
{
 "total": 5,
 "values": [
  {
   "id": "1",
   "name": "Highest",
   "isDefault": false
  },
  {
   "id": "2",
   "name": "High",
   "isDefault": false
  },
  {
   "id": "3",
   "name": "Medium",
   "isDefault": false
  }
 ]
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

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

Sets the priority by id instead of name.

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

```python
import os
import requests

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

Response: HTTP 200

```
{
 "key": "ZZREF-11",
 "fields": {
  "priority": {
   "self": "https://your-domain.atlassian.net/rest/api/3/priority/1",
   "iconUrl": "https://your-domain.atlassian.net/images/icons/priorities/highest_new.svg",
   "name": "Highest",
   "id": "1"
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /rest/api/3/issue

Creates a work item with the priority given by id.

```bash
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": "Priority by id",
    "priority": {
      "id": "{priorityId}"
    }
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'
```

```python
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': 'Priority by id',
                     'priority': {'id': '{priorityId}'}}},
)
print(r.status_code, r.text)
```

Response: HTTP 201

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

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- {"priority": {"name": "High"}} answered 200. The response held the priority object with id 2 and name High (sys-priority).
- An unknown name answered 400 with errors.priority set to Specify the Priority (name) in the string format, even though the request used an object (sys-priority-bad).
- The edit metadata lists priority with the set operation and an allowedValues array whose first values are Highest, High and Medium (editmeta-zz).
- {"priority": {"id": ...}} answered 200 on edit and 201 on create (sys-priority-id, sys-create-with-priority-id).
- GET /rest/api/3/priority/search listed 5 priorities with id, name and isDefault (priorities-list).

## Pitfalls

- The error text suggests a string is wanted. The cause in the run was the unknown name, so check the allowed values first.
- Priority names come from the site's priority list. A script that hard-codes High may fail where the list differs, so read allowedValues when portability matters.
- Ids are strings in the responses ("2"), so send them as strings.

## Questions and answers

### How do I find the valid priority names?

Read allowedValues for priority from the edit metadata of a work item, or from the create metadata for the project and work type.

### What does the priority look like when read?

An object with self, iconUrl, name and id. The name and id are the values to compare.

## Related

- [Field ids, keys and names](https://goingstellar.ro/reference/jira-fields/field-ids-and-names/)
- [Which fields can be set: editmeta and createmeta](https://goingstellar.ro/reference/jira-fields/editmeta-createmeta-fields/)
- [Reading field values: names, schema, v2 and v3](https://goingstellar.ro/reference/jira-fields/reading-field-values/)
- [labels](https://goingstellar.ro/reference/jira-fields/labels-field/)
- [Read-only and computed system fields](https://goingstellar.ro/reference/jira-fields/read-only-system-fields/)

## Sources

- [Issues (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/)
- [Edit issue (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put)
- [Get issue (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)
- [Get edit issue metadata (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-editmeta-get)

