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
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
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>
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.