Skip to content

Commit

Permalink
fix paginated projects retrieving
Browse files Browse the repository at this point in the history
Fixes #1310
  • Loading branch information
ebaschiera authored Mar 2, 2024
1 parent 0a5bc5e commit 1a16347
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -2324,13 +2324,18 @@ def projects_from_cloud(self, included_archived=None, expand=None):
included_archived=included_archived,
expand=expand,
)
while not projects.get("isLast"):
projects["values"].extend(
self.paginated_projects(
is_last_page = projects.get("isLast")
next_page_url = projects.get("nextPage")
while not is_last_page:
next_page_projects = self.paginated_projects(
included_archived=included_archived,
expand=expand,
url=projects["nextPage"],
)["values"]
url=next_page_url,
)
next_page_url = next_page_projects.get("nextPage")
is_last_page = next_page_projects.get("isLast")
projects["values"].extend(
next_page_projects["values"]
)
return projects["values"]

Expand Down

0 comments on commit 1a16347

Please sign in to comment.