Repository navigation
feat(jtk): add issues rank to re-order issues before or after another - #509
Closed
flythebluesky wants to merge 1 commit into
Closed
flythebluesky wants to merge 1 commit into
flythebluesky wants to merge 1 commit into
Conversation
`jtk issues rank <issue-key>... (--before <issue-key> | --after <issue-key>)` moves issues, in the order given, to sit immediately before or after another issue in Jira's rank - the order boards and backlogs show - through the Agile `PUT /rest/agile/1.0/issue/rank` endpoint. - Exactly one of --before / --after (cobra mutually-exclusive + one-required); the anchor may not be among the ranked issues. - Lists over the endpoint's 50-issue cap go in order-preserving chunks (each --after chunk anchors on the previous chunk's last issue). - A 207 Multi-Status names each refused issue in the error (non-zero exit); --id emits the ranked keys. - No prompt: re-ranking loses no data (GUARDRAILS 5.1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Moved to a same-repo branch: #510. |
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.
Summary
Adds
jtk issues rank. It moves one or more issues to sit immediately before or after another issue in Jira's rank, the order boards and backlogs show. Today the only way to re-order a backlog is dragging cards in the web UI.jtk issues rank PROJ-7 --before PROJ-3 jtk issues rank PROJ-7 PROJ-8 PROJ-9 --after PROJ-3 # keeps the given orderBehaviour
PUT /rest/agile/1.0/issue/rank, via a newapi.Client.RankIssues.--before/--afteris required. Cobra enforces this: the two are mutually exclusive and one is required. The anchor may not be one of the issues being ranked.--before, every chunk is placed before the anchor. With--after, each chunk anchors on the previous chunk's last issue.207 Multi-Statusresponse names each refused issue and Jira's reason in the error, and the command exits non-zero. Issues that were ranked are not reported as failures.Ranked PROJ-7, PROJ-8 before PROJ-3. With--id, it emits only the ranked keys.--force: re-ranking moves issues within the order and loses no data (GUARDRAILS §5.1).Design notes for review
rankisn't in the GUARDRAILS §1 verb table. I chose it because it's Jira's own term for this operation, andmovealready means "move to another project" here. Happy to rename if you'd prefer another verb.--before/--afterare long-only, following §4.4 (one-off operation knobs). The issues are the positional subject (§2.2).Tests
api/rank_test.go: before and after bodies, 207 parsing, chunking in both directions, the exactly-one-anchor guard, and an API error stopping at the failing chunk.internal/cmd/issues/rank_test.go: success output,--id, flag validation, refusing the anchor among the issues, and reporting refused issues.golangci-lint run ./...intools/jtk: 0 issues.internal/config, a file-permission mode. One is ininternal/cmd/refresh, which found real credentials on the machine. One is inapi,TestAddAttachment, a path separator. Your Linux/macOS CI should show the real picture.Docs
tools/jtk/README.mdsection.skills/Jira/CliReference.mdandskills/Jira/SKILL.md.Verified live
Against a Jira Cloud site: I ranked an issue before another, read the order back with
jtk issues search --jql '... ORDER BY rank', then restored it with--after.🤖 Generated with Claude Code