Skip to content

Commit e0a7c6f

Browse files
authored
[Jira] fix paginated projects retrieving (#1343)
* fix paginated projects retrieving Fixes #1310 * fix indentation * fix format
1 parent 0a5bc5e commit e0a7c6f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

atlassian/jira.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,14 +2324,17 @@ def projects_from_cloud(self, included_archived=None, expand=None):
23242324
included_archived=included_archived,
23252325
expand=expand,
23262326
)
2327-
while not projects.get("isLast"):
2328-
projects["values"].extend(
2329-
self.paginated_projects(
2330-
included_archived=included_archived,
2331-
expand=expand,
2332-
url=projects["nextPage"],
2333-
)["values"]
2327+
is_last_page = projects.get("isLast")
2328+
next_page_url = projects.get("nextPage")
2329+
while not is_last_page:
2330+
next_page_projects = self.paginated_projects(
2331+
included_archived=included_archived,
2332+
expand=expand,
2333+
url=next_page_url,
23342334
)
2335+
next_page_url = next_page_projects.get("nextPage")
2336+
is_last_page = next_page_projects.get("isLast")
2337+
projects["values"].extend(next_page_projects["values"])
23352338
return projects["values"]
23362339

23372340
def paginated_projects(self, included_archived=None, expand=None, url=None):

0 commit comments

Comments
 (0)