Repository navigation
[Confluence] ConfluenceV2.get_page_id: look up blog posts when type="blogpost" - #1702
Merged
gonchik merged 1 commit intoOct 24, 2026
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 attype: it always went throughget_page_by_title(), which queriesapi/v2/pages. Soreturns
Nonefor 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 samespace-id,titleandstatusfilters as/pages. Withtype="blogpost",get_page_id()now resolves the space key and queries that endpoint instead. Othertypevalues still go throughget_page_by_title()as before, and a missing space returnsNonethe same way it does for pages. I added"blogpost": "api/v2/blogposts"to the V2 endpoint map and noted thetypeargument next toget_page_idindocs/confluence.rst.Tests: added
test_get_page_id,test_get_page_id_for_blogpostandtest_get_page_id_for_blogpost_not_foundtotests/test_confluence_v2.py. The blogpost one fails on master (the request goes toapi/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.