Skip to content

[Confluence] ConfluenceCloud.page_exists: check blog posts when type="blogpost" - #1703

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-page-exists-blogpost
Oct 25, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-page-exists-blogpost

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

docs/confluence.rst documents confluence.page_exists(space, title, type=None) with type 'page' or 'blogpost', and the Server client handles both. The Cloud client (Confluence(url="https://<site>.atlassian.net") / ConfluenceCloud) has no type argument, so it ends up in **kwargs and is sent as an extra query parameter to api/v2/pages. That means

confluence.page_exists("SPACE", "Release notes", type="blogpost")

only ever searches pages and returns False for an existing blog post (or True if a page happens to have the same title).

page_exists() now takes type explicitly. With type="blogpost" it queries GET /wiki/api/v2/blogposts, which takes the same space-id, title and status filters as /pages, after the same space key lookup. Any other value still goes to api/v2/pages, and type is no longer forwarded as a query parameter. This is the same split as ConfluenceV2.get_page_id() from #1702.

Tests: added test_page_exists_uses_v2_blogpost_endpoint_for_blogpost_type and test_page_exists_does_not_send_page_type_to_v2 to tests/confluence/test_confluence_cloud.py; both fail on master. The full pytest suite and tox -e mypy pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.

…"blogpost"

The docs say page_exists() takes type="page" or "blogpost", but the
Cloud client passed type through **kwargs as an extra query parameter
on api/v2/pages, so page_exists(space, title, type="blogpost") only
ever looked at pages and returned False for an existing blog post.

Take type as an explicit argument and query api/v2/blogposts with the
same space-id/title/status filters when it is "blogpost". type is no
longer sent to the V2 pages endpoint.
@gonchik
gonchik merged commit 2df0553 into atlassian-api:master Oct 25, 2026
3 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