Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.6.3, 6.6.4
-
1
-
Severity 3 - Minor
-
0
-
Description
Summary
When creating content from REST API, you are required to pass an ancestor ID to specify where this page is created
Steps to Reproduce
- Login to Confluence
- Create a new page Test Page 1
- Get the ID of the page (you can edit the page and get it from the URL, or from the head section in the HTML source)
- Delete Test Page 1
- Don't clear the trash
- Use the following CURL to create a page using REST API
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"MySecondPage", "ancestors":[{"id":"11111112"}], "space":{"key":"TEST"},"body":{"storage":{"value":"<p>This is a new subpage</p>","representation":"storage"}}}' http://localhost:8090/confluence/rest/api/content/ | python -mjson.tool
Expected Results
The page should not be created and should tell the user that the ancestor page doesn't exist
Actual Results
- Page is successfully created
- Page is not visible in the page tree under the Space home
- Page becomes a new root next to the Space home
Please note that having multiple root pages will introduce a performance impact on content creation (from the UI as well as from the REST API)
Workaround
- The workaround is to restore the page Test Page 1 from the trash and move both under the Space home.
- Restore Test Page 1 before creating the new page using REST API