Skip to content

[Confluence] ConfluenceCloud: add remove_page_from_trash and remove_page_as_draft - #1707

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-remove-page-from-trash
Oct 27, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-remove-page-from-trash

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

docs/confluence.rst documents confluence.remove_page_from_trash(page_id) and confluence.remove_page_as_draft(page_id), and the Server client has both. The Cloud client (Confluence(url="https://<site>.atlassian.net") / ConfluenceCloud) doesn't, so they fail with:

AttributeError: 'Cloud' object has no attribute 'remove_page_from_trash'

Now that Cloud has remove_page() (#1705), this adds both helpers to Cloud with the same behaviour as the Server client:

  • remove_page_from_trash() calls remove_page(page_id, status="trashed"), which sends DELETE /wiki/rest/api/content/{id}?status=trashed to purge a trashed page;
  • remove_page_as_draft() calls remove_page(page_id, status="draft");
  • both return what remove_page() returns (normally 204, or the raw response with advanced_mode=True) and raise the same errors.

I also added a line to the remove_page_from_trash entry in docs/confluence.rst saying both work on Cloud.

Tests: added three tests to tests/confluence/test_confluence_cloud.py (each method on ConfluenceCloud, and both through Confluence(url="https://test.atlassian.net")); they fail on master with the error above. The full pytest suite, tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.

…age_as_draft

docs/confluence.rst documents remove_page_from_trash(page_id) and
remove_page_as_draft(page_id), and the Server client has both, but the
Cloud client does not, so Confluence(url="https://<site>.atlassian.net")
and ConfluenceCloud raise "'Cloud' object has no attribute
'remove_page_from_trash'".

Add both to Cloud with the same behaviour as the Server client: they call
remove_page with status="trashed" and status="draft", which sends DELETE
to /wiki/rest/api/content/{id} with that status.
@gonchik
gonchik merged commit f04c86e into atlassian-api:master Oct 27, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants