Set Issue to 'Unassigned' via API

In an automated workflow, I am trying to edit an issue that is already In Progress to set the assignee as ‘Unassigned’.

I have tried to many different endpoints. The expected one would be /issue/{issue_id}/assignee, but setting the accountId as ‘-1’ or null don’t work.

I also get 405 method not allowed on many of these requests. I doubt it would be a permission issue as I have been able to comment and resolve tickets, so I’m not sure why I wouldn’t be able to assign them. I also want to add that the base_url is jira.companyname.com instead of what I see on all the documentation, companyname.atlassian.net incase that makes a difference.

Please advise!

Hello @LundEmma

Firstly, if the URL to your Jira instance is not in the format of ‘(companyname).atlassian.net’ then you’re using Jira SERVER or Jira DATA CENTER, not Jira CLOUD, so you’ve used the wrong subject tag for your question.

For those versions of Jira, you do indeed use the issue-assign endpoint and set the accountId to null to allocate no assignee, just as it says in the documentation.

Since you haven’t provided any code samples of your API request, there’s no way to know whether or not you have created a valid, properly formatted request.

Next, you said you got a 405 error in response. That normally indicates that you tried to to a POST request to the endpoint, not a PUT request.

Also, can you remove the assignee from the Issue via the web GUI to confirm the Project hasn’t been configured to add a default assignee to every Issue, so having an Issue with no Assignee would not be possible?

Thank you. Yes, I was confused between the Jira Server vs Jira Cloud which is why I mentioned it!

I was in fact using PUT the whole time. Already confident that an ‘Unassigned’ assignee was possible.

I was using /rest/api/3/issue/{issue_id}/assignee and then using accountId as this documentation said name was deprecated (I was using the Cloud documentation considering my confusion as discussed already.)

It works changing it to /rest/api/2/issue/{issue_id}/assignee and sending in {“name”: null}

Appreciate the help!

2 Likes

Subject changed to Jira Development - Server