Skip to content

[Confluence] ConfluenceV2.get_page_id: look up blog posts when type="blogpost" - #1702

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-v2-get-page-id-blogpost
Oct 24, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-v2-get-page-id-blogpost

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

ConfluenceV2.get_page_id() has the same signature as the Server version, get_page_id(space, title, type="page"), but the V2 implementation never looked at type: it always went through get_page_by_title(), which queries api/v2/pages. So

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

returns None for an existing blog post, or the ID of a page with the same title if there is one.

In V2, blog posts have their own endpoint (GET /wiki/api/v2/blogposts), which takes the same space-id, title and status filters as /pages. With type="blogpost", get_page_id() now resolves the space key and queries that endpoint instead. Other type values still go through get_page_by_title() as before, and a missing space returns None the same way it does for pages. I added "blogpost": "api/v2/blogposts" to the V2 endpoint map and noted the type argument next to get_page_id in docs/confluence.rst.

Tests: added test_get_page_id, test_get_page_id_for_blogpost and test_get_page_id_for_blogpost_not_found to tests/test_confluence_v2.py. The blogpost one fails on master (the request goes to api/v2/pages). 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.

…blogpost"

get_page_id() accepts a type argument like the Server version, but the
V2 implementation ignored it and always searched api/v2/pages, so
get_page_id(space, title, type="blogpost") never found the blog post.

When type is "blogpost", resolve the space key and query
api/v2/blogposts with the same space-id/title/status filters instead.
@gonchik
gonchik merged commit e75f438 into atlassian-api:master Oct 24, 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