Unable to create subtasks using REST API

I am able to create JIRA subtasks manually but when I use Postman POST request for doing the same I am getting below error.

"The default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off"

I am following the same steps explained at https://developer.atlassian.com/jiradev/jira-apis/about-the-jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue?_ga=2.266412365.272927713.1514442347-2114113685.1505727766#JIRARESTAPIExample-CreateIssue-Exampleofcreatinganissueusingprojectkeysandfieldnames

Using below data for my POST request:

{
"fields":
{
"project":
{
"key": "XX"
},
"parent":
{
"key": "XXX-3604"
},
"summary": "Some text",
"description": "some text",
"issuetype":
{
"id": "10",
"assignee":
{
"name": "username"
}
}
}
}

Can anyone help me pointing out to the issue as creating subtask is manually possible. Is there any other setting required before creating sub-task through REST API's.

 

Please help, its urgent!

 

3 answers

0 votes

As the error message says, your code is not setting a valid assignee. 

You need to set it to a valid  user, one who has the "can be assigned issues" permission, or leave it out completely and make sure the global setting for "allow unassigned issues" is on.

I'm setting it to a valid user. And after your suggestion I removed assignee value from my POST data. Still getting same error. I also want to mention that I'm able to assign to that user manually.

Also, please tell me how to ensure global setting "allow unassigned issues" is ON.

Appreciate your prompt response.

You clearly are not setting it to a valid user.  The error message clearly states that it is trying to use the default assignee in the project, and that user does not have the right to be assigned issues.

Go back to the basics:

What user is performing this request?  Do they have the right to assign issues?

What username are you sending?  The login id?  Is that user assignable?

The issue is resolved now. It was not because of incorrect user rather the syntax of JSON body I was sending.
I wrote assignee inside the issuetype key but it should be used outside as separate key. It worked after that.
"issuetype":
{
"id": "10"
},
"assignee":
{
"name": "username"
}

0 votes
Alexey Matveev Community Champion Dec 29, 2017

Hello,

Make sure that you provide user name not the user display name.

I'm using the user name itself. 
Also, as mentioned I tried creating sub task without giving username but still I was getting same error.

Is there any other resolution for the same.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

282 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot