Skip to content

[Confluence] Add expand option to get_all_pages_by_label #1454

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
Sep 15, 2024
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 @@ -522,13 +522,14 @@
# operate differently between different collaborative modes
return self.get_page_by_id(page_id=page_id, expand=expand, status=status)

def get_all_pages_by_label(self, label, start=0, limit=50):
def get_all_pages_by_label(self, label, start=0, limit=50, expand=None):
"""
Get all page by label
:param label:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
fixed system limits. Default: 50
:param expand: OPTIONAL: a comma separated list of properties to expand on the content
:return:
"""
url = "rest/api/content/search"
Expand All @@ -539,6 +540,8 @@
params["start"] = start
if limit:
params["limit"] = limit
if expand:
params["expand"] = expand

Check warning on line 544 in atlassian/confluence.py

View check run for this annotation

Codecov / codecov/patch

atlassian/confluence.py#L544

Added line #L544 was not covered by tests

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