Skip to content
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

jipcreate: sprints: find all sprints #81

Merged
merged 1 commit into from
Aug 6, 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
21 changes: 20 additions & 1 deletion jipdate/jipcreate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ def initialize_logger(args):
}


def get_sprints(jira, board_id):
# We need to loop over sprints the API returns maximum 50 sprints.
MAX_SPRINTS = 50
sprints_in_board = []
start_at = 0
is_last = False

while not is_last:
# We need a tmp variable to read the resultlist metadata.
tmp = jira.sprints(board_id=board_id, maxResults=MAX_SPRINTS, startAt=start_at)
sprints_in_board = sprints_in_board + tmp
is_last = tmp.isLast
start_at += MAX_SPRINTS

return sprints_in_board


################################################################################
# Main function
################################################################################
Expand Down Expand Up @@ -225,7 +242,9 @@ def main():
log.debug(f"* {board}")
if board.type == "kanban":
continue
sprints_in_board = jira.sprints(board_id=board.id)

sprints_in_board = get_sprints(jira, board.id)

log.debug(f" + Sprints:")
for sprint in sprints_in_board:
log.debug(f" - {sprint}")
Expand Down
Loading