Home/Atlassian REST API reference
Jira and Confluence Cloud REST API
Edit a Jira work item with the REST API
PUT /rest/api/3/issue/{issueIdOrKey} changes fields with a fields object or an update object and answers 204 with no body. Add returnIssue=true to get the edited work item back with a 200. PATCH is not supported on this path.
Endpoints
| Method | Path | What it does |
|---|---|---|
PUT | /rest/api/3/issue/{issueIdOrKey} | Edits a work item using fields and update; transitions are ignored. |
Examples
PUT /rest/api/3/issue/{issueIdOrKey}
Change the summary with fields.summary. The answer is 204 and has no body.
curl
curl -X PUT \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "REST API reference test issue - edited"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.put(
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'fields': {'summary': 'REST API reference test issue - edited'}},
)
print(r.status_code, r.text)Response: HTTP 204
No response body.
Response headers
X-Ratelimit-Limit: 300
X-Ratelimit-Remaining: 298Sent to Atlassian Cloud on .
PUT /rest/api/3/issue/{issueIdOrKey}
Set labels and ask for the edited work item back with returnIssue and fields. The 200 body holds only the field that was edited.
curl
curl -X PUT \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"labels": [
"alpha",
"beta"
]
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?returnIssue=true&fields=summary,labels'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=summary,labels',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
params={'returnIssue': 'true', 'fields': 'summary,labels'},
json={'fields': {'labels': ['alpha', 'beta']}},
)
print(r.status_code, r.text)Response: HTTP 200
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "10766",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10766",
"key": "WEB-55",
"fields": {
"labels": [
"alpha",
"beta"
]
}
}Sent to Atlassian Cloud on .
PUT /rest/api/3/issue/{issueIdOrKey}
Pass notifyUsers=false to suppress the watcher email. The status stays 204.
curl
curl -X PUT \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "REST API reference test issue"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?notifyUsers=false'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.put(
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}?notifyUsers=false',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
params={'notifyUsers': 'false'},
json={'fields': {'summary': 'REST API reference test issue'}},
)
print(r.status_code, r.text)Response: HTTP 204
No response body.
Sent to Atlassian Cloud on .
PUT /rest/api/3/issue/{issueIdOrKey}
A field id that is not on the screen is refused with a field error.
curl
curl -X PUT \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"customfield_99999": "x"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.put(
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'fields': {'customfield_99999': 'x'}},
)
print(r.status_code, r.text)Response: HTTP 400
{
"errorMessages": [],
"errors": {
"customfield_99999": "Field 'customfield_99999' cannot be set. It is not on the appropriate screen, or unknown."
}
}Sent to Atlassian Cloud on .
PATCH /rest/api/3/issue/{issueIdOrKey}
PATCH on the same path does not reach the API. A proxy answers 400 with an HTML page.
curl
curl -X PATCH \
-u "you@example.com:$ATLASSIAN_API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "x"
}
}' \
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}'Python (requests)
import os
import requests
EMAIL = "you@example.com"
r = requests.patch(
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
headers={'Accept': 'application/json'},
json={'fields': {'summary': 'x'}},
)
print(r.status_code, r.text)Response: HTTP 400
<title>400 Bad Request</title>Sent to Atlassian Cloud on .
How it behaves
- A plain edit answers 204 with an empty body; the new values are only visible through a later GET.
- With returnIssue=true the answer is 200 and the body is the work item in the Get issue shape. The fields object in it held only labels, the field edited, although summary was named in the fields query parameter.
- notifyUsers=false was accepted and answered 204. The spec says the flag is ignored for users without administer permissions.
- A field that is not editable for the work item gives 400 with the message "Field 'customfield_99999' cannot be set. It is not on the appropriate screen, or unknown."
- PATCH was answered by nginx with a text/html 400 page, not a Jira JSON error.
Pitfalls
- Use PUT. PATCH comes back as an HTML 400 that no JSON parser will accept.
- The same field cannot appear in both fields and update in one request; see the update operations page for the error text.
- Transitions are not applied by this call. The spec states a transition in the body is ignored; use the transitions endpoint to change status.
- Send the field ids shown by editmeta. A field hidden from the edit screen fails even if the id is valid.
Questions and answers
Does an edit return the updated work item?
Only if you add returnIssue=true. Otherwise the answer is 204 with no body.
Can I change the status with PUT?
No. The spec says transitions are ignored by this call. Use POST on the transitions endpoint.
Related
- Update operations (add, remove, set)
- editmeta
- Transitions
- Assign a work item
- Get a work item
- Delete a work item