I followed this article https://confluence.atlassian.com/jirakb/how-to-set-assignee-to-unassigned-via-rest-api-in-jira-744721880.html.
Tried both
```
"assignee": { "name": "-1" }
and
"assignee": { "name": null }
```,
but the newly created story is always assigned to myself.
I've also tried ```"assignee": null``` and got the same result.
Anyone has any luck creating an "Unassigned" story?
Hello @danihuan
Welcome to the Atlassian community.
Are you using the API to try to set the assignee to Unassigned after you have completed creation of the issue, or are you trying to set the assignee to Unassigned in the same API call that creates the issue?
It should also be noted that the article is from the Jira Server KB, not the Jira Cloud KB. It may not apply to the Jira Cloud API.
Hi @Trudy P Claspill
I am setting the assignee and creating the issue in one call, using the endpoint /rest/api/2/issue.
Payload looks like:
{"fields": {"project": {"key": "CDMG"},"parent": {"key": "CDMG-1812"},"issuetype": {"name": "Story"},"summary": "[DnA - DDC] an awesome story","description": "something awesome","priority": {"id": "3"},"assignee": { "accountId": "-1" } <--- also tried null}}
For Jira CLOUD, when you create the issue, if you do not set the assignee (IE, totally omit the assignee object from the body of the request) the assignee will be 'unassigned', unless a default assignee for all Issues has been set in the Project settings.
Have you also checked to see if an automation rule on that Project isn't setting the Assignee to you?
Also, are you 100% sure you're not confusing the Issue Assignee with the Reporter?
Is there a reason you are using v2 rather than v3?
Are you able to create an issue in this project through the UI and have the Assignee set to Unassigned?
only reason is I am not aware of v3. Do I just change the endpoint to /rest/api/3/issue to use v3? I suppose the payload schema remains the same?
Yes, using UI I can create an issue and set it to Unassigned. Thanks for the question, I'll inspect the request made from UI and see what I can find.
I checked again by inspecting the payload when using UI to create a new issue. If I set the assignee to unassigned, the payload has "assignee": null. However, the issue created is assigned to myself. So it seems that there is no way to created an "unassigned" issue with the REST API.
Hi @[deleted]
Yeah, I am certain this is Assignee, not Reporter.
I think there is a default assignee. But I don't think I have the privilege to see that particular configuration. I'll give it a try with omitting the assignee object to verify.
Thanks for the tip!
Did it work? If so, please mark the answer as correct.
I can confirm that by omitting the assignee object, the issue created is assigned to the default assignee. So this won't work for me as I want it 'unassigned'.
I know this is an old thread... I found it while investigating this same issue, so I thought I'd post what worked for me.
I'm using V2 of the API on Jira Data Center Edition (not Cloud), and scripting in Python. I set the "assignee" key to None (Null in other languages), and found that it did correctly set the Assignee to Unassigned, in a project that has a Default Assignee.
This works:
"assignee": null
This does not work:
It looks like you're new here. Sign in or register to get started.