Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

"Project is Required" when providing a proper project key

Andrew Zibuda
Contributor
October 23, 2018

I am seeing an error when trying to create issue via REST API:

 

POST request to /rest/api/2/issue returned an error code: status: 400 - Bad Request
body: {"errorMessages":[],"errors":{"project":"project is required"}}

 

With this request:

 

 post("/rest/api/2/issue")
.header("Content-Type", "application/json")
.body([
fields: [
summary: newIssue.fields.summary,
customfield_10008: issue.key,
assignee: [
key: newIssue.fields.assignee.key,
name: newIssue.fields.assignee.name]
],
cutomfield_10201: newIssue.fields.customfield_10201,
description: newIssue.fields.description,
project:[
key: issue.fields.project.key]
]
)
.asString() 

 

This exact same format for a POST including the project key works perfectly in a different POST that creates an Epic. This one is for a story but that shouldn't change anything. Not sure if this is a bug or what. 

2 answers

0 votes
Nagarjuna Guntupalle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 14, 2019

Is this fixed, I am stuck at same error?

0 votes
Gonchik Tsymzhitov
Community Champion
October 23, 2018

Hi! 

 

Looks like it is typo, 

let's try this format


"project": [
"id": issue.fields.project.id ],

 instead of as array

 

Cheers,

Gonchik Tsymzhitov

Andrew Zibuda
Contributor
October 24, 2018

That is the current format. Using ID field results in same error.

Suggest an answer

Log in or Sign up to answer