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
@sunnyape I’m trying to create an issue without an assignee, but I keep getting 400 responses. (using v3 POST /rest/api/3/issue)
I’ve tried all these combinations:
{fields: {assignee: null}}
{fields: {assignee: {id: null}}}
{fields: {assignee: {id: -1}}}
{fields: {assignee: {accountId: null}}}
{fields: {assignee: {accountId: -1}}}
Nothing works. I have to make the extra roundtrip of patching the issue after creation…
Hello @NiklasCorrenz
Firstly, please don’t hijack other people’s threads, especially ones that have already been solved and were for a different product. This thread was about Jira SERVER, not Jira CLOUD.
Next, please don’t directly @ mention people just to draw attention to your question. It’s considered improper behaviour. Please don’t do it again.
Next, when creating a new Issue by POSTing to the Jira CLOUD v3 Create Issue endpoint, (and the equivalent v2 endpoint) the Issue will have no assignee if you just totally omit the assignee field entirely from the list of fields (don’t declare the field and it will have no value). This of course doesn’t preclude that it’s possible for the Project in question to be configured to require the Assignee field to contain a value for certain Issue types , or to have a default Assignee, or that an automation rule is setting the Assignee after the event of the Issue being creating via the REST API.
And lastly, try using Google first. If you had searched for “jira cloud rest api create issue with no assignee” the very first result returned is where I’ve provided the same answer to the same question over on the general Community forum. That article has been found and read 3,230 times.
Hello, thank you for your kind reply.
I’m sorry to have misbehaved here by mentioning you. And I didn’t realize this question was for the server version because I saw the year 2024 (which is past the end of the server version) and you are displayed as a cloud developer. And I’m still trying to get my head around that these were actually vastly different products.
I did google quite a lot and tried to solve my problem via experimentation before asking, of course! And by the way, my first google search result for those phrases leads to https://community.atlassian.com/t5/Jira-questions/using-rest-API-to-create-Jira-story-and-assign-it-to-quot/qaq-p/2404384, which is not helping, it only states that it would work in v2. The 2nd search result is this thread. Then follow mostly outdated results about v2.
If I leave the assignee unset in v3, then I get the configured default assignee, which would be expected for an unset field. However, that’s not what I want. I want to explicitly set the assignee to “Unassigned” for a new issue.
Anyway, thanks for your time.
For Jira Cloud, except for declaring rich text fields using ADF instead of Wiki markdown, both the v2 and v3 Create Issue endpoints behave in exactly the same manner.
As described in the other thread in the public Community forum, if Jira has been configured to set a default assignee for newly created Issues, there’s absolutely nothing that the Create Issue endpoint(s) can do to over-ride that fact, so you must do separate REST API call to edit the Issue after it has been created and remove the Assignee… exactly the same as you would have to do via the GUI.