From bfd9cdf62491ef0f1d6db127270f39952f5573c4 Mon Sep 17 00:00:00 2001 From: star7js <126814341+star7js@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:15:19 -0600 Subject: [PATCH] Add page_exists, blog_post_exists, and title lookup methods to Confluence Cloud (closes #581) 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. --- atlassian/confluence/cloud/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/atlassian/confluence/cloud/__init__.py b/atlassian/confluence/cloud/__init__.py index d3c12a7d5..28b4520c6 100644 --- a/atlassian/confluence/cloud/__init__.py +++ b/atlassian/confluence/cloud/__init__.py @@ -60,6 +60,24 @@ def get_content_ancestors(self, content_id, **kwargs): """Get ancestor content.""" return self.get(f"content/{content_id}/ancestors", **kwargs) + def get_page_by_title(self, space_key, title, **kwargs): + """Get page by title and space key.""" + return self.get("content", params={"spaceKey": space_key, "title": title, "type": "page", **kwargs}) + + def get_blog_post_by_title(self, space_key, title, **kwargs): + """Get blog post by title and space key.""" + return self.get("content", params={"spaceKey": space_key, "title": title, "type": "blogpost", **kwargs}) + + def page_exists(self, space_key, title, **kwargs): + """Check if page exists.""" + result = self.get_page_by_title(space_key, title, **kwargs) + return len(result.get("results", [])) > 0 + + def blog_post_exists(self, space_key, title, **kwargs): + """Check if blog post exists.""" + result = self.get_blog_post_by_title(space_key, title, **kwargs) + return len(result.get("results", [])) > 0 + # Space Management def get_spaces(self, **kwargs): """Get all spaces."""