Skip to content

Add the type parameters whether a page exists #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ def _get_paged(self, url, params=None, data=None, flags=None, trailing=None, abs

return

def page_exists(self, space, title):
def page_exists(self, space, title, type=None):
"""
Check if title exists as page.
:param space: Space key
:param title: Title of the page
:param type: type of the page, 'page' or 'blogpost'. Defaults to 'page'
:return:
"""
url = "rest/api/content"
Expand All @@ -98,6 +99,8 @@ def page_exists(self, space, title):
params["spaceKey"] = str(space)
if title is not None:
params["title"] = str(title)
if type is not None:
params["type"] = str(type)

try:
response = self.get(url, params=params)
Expand Down