Skip to content
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
23 changes: 19 additions & 4 deletions atlassian/bamboo.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,25 @@ def delete_label(self, project_key, plan_key, build_number, label):

def get_projects(self):
"""Method used to list all projects defined in Bamboo.
Projects without any plan are not listed by default, unless showEmpty query param is set to true."""
resource = "project?showEmpty"
for project in self.get(self.resource_url(resource)):
yield project
Projects without any plan are not listed."""
start_idx = 0
max_results = 25

while True:
resource = "project?start-index={}&max-result={}".format(start_idx, max_results)

r = self.get(self.resource_url(resource))

if r is None:
break

if start_idx > r["projects"]["size"]:
break

start_idx += max_results

for project in r["projects"]["project"]:
yield project

def get_project(self, project_key):
"""Method used to retrieve information for project specified as project key.
Expand Down