Open
Conversation
Allow filtering issues by sprint when listing. The flag accepts: - A sprint name (e.g. --sprint "Sprint 42") - A numeric sprint ID (e.g. --sprint 123) - Keywords: current/active (openSprints), closed/previous (closedSprints), future/next (futureSprints) The flag is repeatable to filter across multiple sprints. Also adds JQL.InFunc() helper for unquoted function-call values in IN clauses (e.g. sprint IN openSprints()).
Addresses prealloc warning from golangci-lint on CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR solve?
Adds a
--sprintflag tojira issue listso users can filter issues by sprint without dropping down to raw--jql.The flag accepts sprint names, numeric IDs, or one of the keywords
current/active,closed/previous,future/next, and is repeatable.--sprint "Sprint 42"sprint IN ("Sprint 42")--sprint 1226sprint IN (1226)(unquoted numeric ID)--sprint currentsprint IN openSprints()--sprint closedsprint IN closedSprints()--sprint futuresprint IN futureSprints()--sprint 1226 --sprint "Sprint 42"sprint IN (1226, "Sprint 42")--sprint current --sprint activesprint IN openSprints()(deduplicated)Numeric values are emitted unquoted so Jira interprets them as sprint IDs; non-numeric values are quoted as sprint names. This matches Jira's JQL semantics and allows a single mixed
INlist (OR semantics) when the user passes several named/ID values.Implementation notes:
JQL.InFunc(field, fn)helper inpkg/jqlfor unquoted right-hand-sideINclauses (sprint IN openSprints(), mixedsprint IN (1226, "Sprint 42")).Sprints []stringfield added toIssueParams, wired through the existing flag-parsing and JQL-building pipeline ininternal/query.--label/--status(StringArray, repeatable).jira sprint list, where a sprint filter would be redundant.How to test?
Behaviour when
--sprintis omitted is unchanged (no sprint filter applied).Unit tests cover all keyword variants, name-by-string, numeric IDs (unquoted), repeated values, mixed name+ID, keyword deduplication, and the error path. Verified end-to-end against a real Jira Cloud instance for each case above.
Checklist