Skip to content

Commit 90450c6

Browse files
star7jsgonchik
andauthored
Add page_exists, blog_post_exists, and title lookup methods to Confluence Cloud (closes #581) (#1628)
The Server implementation had these methods but the Cloud module was missing them. Adds get_page_by_title, get_blog_post_by_title, page_exists, and blog_post_exists to match Server API parity. Co-authored-by: Gonchik Tsymzhitov <gonchik.tsymzhitov@atlassiancommunity.com>
1 parent 08cc3a5 commit 90450c6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

atlassian/confluence/cloud/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ def get_page_by_title(self, space_key, title, **kwargs):
7979
"""Get page by title and space key."""
8080
return self.get("content", params={"spaceKey": space_key, "title": title, "type": "page", **kwargs})
8181

82+
def get_blog_post_by_title(self, space_key, title, **kwargs):
83+
"""Get blog post by title and space key."""
84+
return self.get("content", params={"spaceKey": space_key, "title": title, "type": "blogpost", **kwargs})
85+
86+
def blog_post_exists(self, space_key, title, **kwargs):
87+
"""Check if blog post exists."""
88+
result = self.get_blog_post_by_title(space_key, title, **kwargs)
89+
return len(result.get("results", [])) > 0
90+
8291
def page_exists(self, space_key, title, **kwargs):
8392
"""Check if page exists in Confluence Cloud."""
8493
result = self.get_page_by_title(space_key, title, **kwargs)

0 commit comments

Comments
 (0)