Jira API edit issue with null parent results in error "We couldn't save your changes. Copy your content, then try reloading the page."

When doing Edit issue PUT /rest/api/3/issue/{issueIdOrKey} by Jira API with body like:

{
    "fields": {
        "parent": null
    }
}

Then it behaves for team managed project:

  • OK, when the issue had some parent before (the parent is removed by the operation).
  • Fails with error 500 “We couldn’t save your changes. Copy your content, then try reloading the page.” when the issue has no parent.

So, such request never pass when issued 2 times. IMHO it breaks REST principles.

I have no such problem with description field, or custom fields: they may be set to null repeatedly. Also, company managed project seems working well, too.

Hi Ondej,
Do you still get this error?
Couple of months ago I have also run into such behaviour. But, as far as I can see now, the error can not be reproduced.

@SergeyGussak I still got the 500 error when setting "parent": null and the issue has no parent. Do you use team managed project?

@OndejMedek Yes, I use team-managed project. I’ve just tested again and the behaviour is very strange for some issues from the project I do get 500 error but for some issues I get 204 success response.

As described above. When the issue has parent, you may unset it by "parent": null, no problem. But it the issue has no parent, you got the error. That’s very inconvenient, you have to get the issue first to know if it has parent or not, then you may update it safely.

@OndejMedek , I do not get error when I send "parent": null for some issues from team-managed project which already does not have parent (i.e. parent = null).

Yeah, Jira world is full of mysteries. One of them is something I call “hidden parent” :ghost: (undocumented :stuck_out_tongue_winking_eye: ). E.g. you have issue 1 - Epic and issue 2 - Story, child of issue 1. You change issuetype of issue 1 to Story and automatically issue 2 has no parent in UI and API. But it has “hidden parent” :ghost:. The parent would appear if you change issue 1 to Epic again. …

Well, I though these hidden parents do not return 500 for "parent": null. But suddenly, they have started to return 500 last week, too! I have not checked it after Halloween, though.

Or, maybe you have hit another mystery? Try to analyse it and share your story.

Seems like this issue has gone.