Skip to content

fix(sprint): fetch all sprint pages so move --to finds sprints beyond the first 50 - #141

Merged
f3rdy merged 1 commit into
masterfrom
fix/sprint-pagination-140
Sep 29, 2026
Merged

f3rdy merged 1 commit into
masterfrom
fix/sprint-pagination-140

Conversation

@f3rdy

@f3rdy f3rdy commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Problem

budjira sprint move ISSUE --to "<name>" failed with Sprint '<name>' not found on board <id> for existing, active sprints as soon as a board has more than 50 sprints (#140).

Cause

SprintService.get_sprints() called python-jira's sprints() without maxResults, which defaults to 50 — only the first page was searched by find_sprint_by_name(), and sprint list without --state showed only the oldest 50 sprints.

Fix

Pass maxResults=False in get_sprints() so all pages are fetched. One place, covers move, list, show and every state filter. The optional "active/future first" two-phase search from the issue was deliberately not implemented: with all pages fetched the search is already complete, and the added complexity buys no correctness.

Tests

4 new tests including the exact reported scenario: a fake client emulating python-jira's 50-per-page truncation with 147 sprints where the active target lives on page 2. Red-green verified (tests fail with the fix stashed). Full suite: 1370 passed, 3 skipped; coverage 89%; all pre-commit hooks green.

Fixes #140

… the first 50

SprintService.get_sprints() called python-jira's sprints() without
maxResults, so only the first page (50 sprints) came back. On boards
with a long sprint history the active sprint is not on that page:
'sprint move ISSUE --to <name>' failed with 'Sprint not found', and
'sprint list' without --state silently showed only the oldest 50.

Pass maxResults=False so python-jira fetches all pages. This covers
every caller (move, list, show, workflow) and every state filter in
one place, so no per-call-site workaround is needed.

Fixes #140
@f3rdy
f3rdy merged commit 115600c into master Sep 29, 2026
5 checks passed
@f3rdy
f3rdy deleted the fix/sprint-pagination-140 branch September 29, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sprint move --to / sprint list: only the first 50 sprints of a board are searched

1 participant