-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
3
-
Severity 3 - Minor
-
6
-
Issue Summary
This is reproducible on Data Center: (no)
Bulk edit dashboard API endpoint returns an error message if there's already an existing permissions of types "group", "global" or "project-unknown" in the dashboard.
Steps to Reproduce
- create a Jira dashboard
- using the UI edit the dashboard and add a "Group" to view or edit permission.
- then using Bulk edit dashboard API try to add a user to the dashboards permission, like this.
curl --location --request PUT 'https://${sitename}.atlassian.net/rest/api/3/dashboard/bulk/edit' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic ....' \ --data '{ "action": "addPermission", "entityIds": [ ${boardId} ], "permissionDetails": { "editPermissions": [ { "user": { "accountId": "${aaId}" }, "type": "user" } ] } }'
Expected Results
The new permissions should be added and we should receive a response like this
{ "action": "addPermission", "entityErrors": {} }
Actual Results
we get a 200 OK but with the following error message in the response body.
{ "action": "addPermission", "entityErrors": { "10002": { "errorMessages": [ "Group ID or group name should be passed when group type is specified." ], "errors": {} } } }
Workaround
The issue is with "action": "addPermission"
We can use "action": "changePermission" to update the permission in the dashboard.
In this case, all existing permissions must also be included along with the new permissions.