Forums

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

Create a board REST API Invalid location object

Andrea Ezeobiejesi
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!
March 9, 2021

When I create a board using a location object that looks like this:

"location": {             

"projectId"10001, 

 "displayName""MY_PROJECT (MYP)",  

"projectName""MY_PROJECT",              

"projectKey""MYP",               

 "projectTypeKey""software",   

"avatarURI""/secure/projectavatar?size=small&s=small&pid=10001&avatarId=10410",               

 "name""MY_PROJECT (MYP)"            }

I get an error message saying the following:

Response: <Response [400]>
{
"errorMessages": [
"Unrecognized field \"projectId\" (Class com.atlassian.greenhopper.api.rest.bean.BoardCreateBean$LocationBean), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@4fef046a; line: 1, column: 91] (through reference chain: com.atlassian.greenhopper.api.rest.bean.BoardCreateBean[\"location\"]->com.atlassian.greenhopper.api.rest.bean.LocationBean[\"projectId\"])"
]
}

The request goes through when I do not include location but then I have to manually set the location of the board in Jira. Does anyone know how to resolve this? Thanks

2 answers

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2021

Hello @Andrea Ezeobiejesi,

Welcome to Atlassian Community!

When creating a board via API, it’s necessary to set only two details on the location as David mentioned.

The documentation for Jira Cloud is this one: 

Please, use the endpoint below that will create a board on a specific project:

curl --request POST \
  --url 'https://xxxxxxxxxx.atlassian.net/rest/agile/latest/board' \
--user 'user@domain.com:API-TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Board Via API",
  "type": "scrum or kanban",
  "filterId": 10000,
  "location": {
    "type": "project",
    "projectKeyOrId": "KEY"
  }
}'

Please, take your time to test and let us know how it goes.

Kind regards,
Angélica

0 votes
Deleted user
March 11, 2021

Which Jira Software Cloud REST API endpoint are you sending the POST request to?

If you are sending the request to the /rest/agile/1.0/board endpoint, then you may want to re-read the documentation here, as the content of the location object can contain only two variables, 'type' and 'projectKeyOrID', like this:

"location": {"type": "<string>", "projectKeyOrId": "<string>" }

You seem to be trying to set the values of lots of different parameters that do not apply to the location object, or boards in general; for example, boards don't have avatars.

Apart from a location object, that endpoint accepts only three other parameters:

"name": "<string>", "type": "<string>", "filterId": <integer>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events