-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Space - Create
-
2
-
Minor
-
6
Issue Summary
Confluence Cloud REST API v2 POST /wiki/api/v2/spaces endpoint can sometimes result in 500 INTERNAL_SERVER_ERROR when roleAssignments field is included in the request body. The same request without roleAssignments succeeds and creates the space as expected.
The same occurs when {{permissions }}field is included in the request body.
Document for reference is here: The Confluence Cloud REST API.
Steps to Reproduce
- On an RBAC-enabled Confluence Cloud tenant:
-
- Retrieve a valid roleId.
-
- Retrieve a valid user accountId to use as principalId.
- Send a space creation request without role assignments:
-
- POST https://<site>.atlassian.net/wiki/api/v2/spaces
-
- Body:
Unknown macro: {Unknown macro}}
- Body:
-
- Observe: request succeeds (200/201) and the space is created.
- Send a space creation request with role assignments using the valid IDs from step 1:
-
- POST https://<site>.atlassian.net/wiki/api/v2/spaces
-
- Body:
{Unknown macro: { { "name": "My Test Space - RoleAssignments", "key": "MTR1", "roleAssignments": [ Unknown macro: \{ "principal"}]}}}
- Body:
-
- Observe: the API returns 500 INTERNAL_SERVER_ERROR with a response similar to:
{{
Unknown macro: { "errors"}
}}
- Observe: the API returns 500 INTERNAL_SERVER_ERROR with a response similar to:
-
- The same tenant and user can create spaces successfully when roleAssignments is omitted.
Expected Results
Create Space endpoint with Roles or permissions included in the request body should succeed with 200 if eligible.
Actual Results
The below exception is thrown
{{{ "errors": [
{ "status": 500, "code": "INTERNAL_SERVER_ERROR", "title": "Internal Server Error", "detail": null }]}}}
Workaround
To remove a role assignment from a principal by calling the Set Space Role Assignments endpoint and omitting the roleId field for that principal.
The following payload will remove the existing role assignment for a given user or group:
[ {
"principal": {
"principalType": "<principalType>",
"principalId": "<principalId>" }
}]
This means you can create a space without roleAssignments, then immediately call the Set Space Role Assignments endpoint to configure exactly the roles you want, including removing any defaults by omitting their roleId.
- is related to
-
CONFCLOUD-83815 Create Space v1: permissions array breaks with Roles experience enabled
-
- Gathering Impact
-
- blocks
-
ECOHELP-100873 Loading...