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.
Is this fixed, I am stuck at same error?
Hi!
Looks like it is typo,
let's try this format
"project": [ "id": issue.fields.project.id ],
instead of as array
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is the current format. Using ID field results in same error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.