Hello!
This issue started last Friday (01/12/2024), we use this python jira sdk to update issues this way:
issue = JIRA(options={'server': JIRA_URL, 'headers': {'Authorization': f'Bearer {access_token}'}}).issue("<the issue id>")
issue.update(fields={"summary": "new summary"})
This started breaking last week: the issue is properly retrieved, but the update fails with a 404. I tracked down the problem to the issue object having an incorrect value for self
in the payload, see the payload returned for the issue during the initial fetch (I replaced our instance UUID with a random one):
{
"expand": <snip>,
"id": "619450",
"self": "https://api.atlassian.com/rest/api/2/issue/619450",
"key": "<snip>",
"fields": {
"parent": {
"id": "619448",
"key": "<snip>",
"self": "https://api.atlassian.com/ex/jira/396b747a-789f-48ec-a637-d0caefeac0ee/rest/api/2/issue/619448",
"fields": {
"summary": "A Summary",
"status": {
"self": "https://api.atlassian.com/ex/jira/396b747a-789f-48ec-a637-d0caefeac0ee/rest/api/2/status/10001",
"description": "",
"iconUrl": "https://api.atlassian.com/ex/jira/396b747a-789f-48ec-a637-d0caefeac0ee/",
"name": "Done",
"id": "10001",
"statusCategory": {
"self": "https://api.atlassian.com/ex/jira/396b747a-789f-48ec-a637-d0caefeac0ee/rest/api/2/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
},
<snip>
"self": "https://api.atlassian.com/rest/api/2/issue/619450"
should be "self": "https://api.atlassian.com/ex/jira/396b747a-789f-48ec-a637-d0caefeac0ee/rest/api/2/issue/619450"
You can see that the fields and the parent ticket have the correct values for self
, but not the ticket we fetched. This causes the update()
call to go to the wrong URL and returns a 404. We updated to the latest version of the SDK. The issue persists even if I provide a jira client explicitly to the update method, because it uses its self.self
attribute to resolve the URL.
We could work around the issue by calling the endpoint directly instead of using the SDK, but this seems to point to a bug in the implementation of the REST API, at least for OAuth apps maybe.
Let me know if I overlooked something, or if there is a misconfiguration in our instance instead.
Thank you,
Remi