Conversation
`jira issue move --comment` sends the comment inline in the transition request's `update.comment` block. Jira applies that only when the target transition has a screen containing the Comment field. Otherwise it performs the transition, returns 204, and silently discards the comment — the user sees "✓ Issue transitioned" and the comment is simply gone. Verified against Jira Cloud on a real workflow: transition with a screen (6 fields) -> comment lands transition with no screen -> HTTP 204, comment discarded The discard cannot be detected from the response: the endpoint returns 204 with an empty body either way. It also cannot be read directly off the transition metadata, because Jira never lists `comment` in the `transitions.fields` expansion — not even for a transition that does accept one. The one usable signal is whether the transition has a screen at all; an empty `fields` map means there is nowhere for the comment to go. - `Transition` gains a `Fields` map and the transitions lookup now requests `expand=transitions.fields`. This adds no request: `issue move` already fetches the transition list to resolve the state name. - `issue move` warns before transitioning when `--comment` is set and the target transition has no screen, pointing the user at `jira issue comment add`. Behavior is otherwise unchanged — the comment is still sent inline, so workflows where it works keep the atomic single-request update. - The `--comment` flag help and the README now state the requirement and the silent-discard failure mode. The README already linked Atlassian's KB article on configuring the workflow, but said only "if your workflow allows", without noting that the comment is lost when it doesn't. A screen that exists but omits the Comment field remains undetectable; that case is documented rather than warned about.
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, well-scoped, and includes tests validating the new transition expansion behavior without altering the underlying transition request semantics.
Pull request overview
This PR improves jira issue move --comment UX by warning users when Jira will accept the transition but silently discard the inline comment due to the target transition having no screen, and documents the limitation.
Changes:
- Extend transition fetching to request
expand=transitions.fieldsand parse the returnedfieldsmap to detect screen-less transitions. - Warn in
jira issue movewhen--commentis used with a transition whosefieldsmap is empty. - Document the failure mode in the README and expand the
--commentflag help text.
File summaries
| File | Description |
|---|---|
| README.md | Documents when Jira discards --comment and recommends jira issue comment add when unsure. |
| pkg/jira/types.go | Adds Transition.Fields to capture transitions.fields expansion data. |
| pkg/jira/transition.go | Requests expand=transitions.fields when listing transitions. |
| pkg/jira/transition_test.go | Adds coverage for parsing fields and asserting the expand query is requested. |
| internal/cmd/issue/move/move.go | Warns before transitioning when --comment is set and the chosen transition has no screen. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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?
jira issue move --commentsends the comment inline in the transition request'supdate.commentblock. Jira applies that only when the target transition has a screen containing the Comment field. Otherwise it performs the transition, returns204, and silently discards the comment — the user sees✓ Issue transitionedand the comment is simply gone.The README already links Atlassian's KB article on configuring the workflow, but says only "if your workflow allows", without noting that the comment is lost when it doesn't.
I verified this against a live Jira Cloud workflow:
DoneTested four ways — a no-op self-transition, a genuine state-changing transition, a hand-built minimal payload, and JiraCLI's own payload. The outcome depends only on whether the transition has a screen, not on whether the status actually changes. This is not a payload bug in JiraCLI: the request it sends is correct and the comment lands wherever Jira accepts it.
The discard cannot be detected from the response, which is
204with an empty body in both cases. It also cannot be read off the transition metadata directly, because Jira never listscommentin thetransitions.fieldsexpansion — not even for a transition that demonstrably accepts one. The one usable signal is whether the transition has a screen at all: an emptyfieldsmap means there is nowhere for the comment to go.Changes:
Transitiongains aFieldsmap, and the transitions lookup now requestsexpand=transitions.fields. This costs no extra request, becauseissue movealready fetches the transition list to resolve the state name.issue movewarns before transitioning when--commentis set and the target transition has no screen, pointing the user atjira issue comment add. Behavior is otherwise unchanged — the comment is still sent inline, so workflows where it works keep the atomic single-request update.--commentflag help and the README now state the requirement and the failure mode.A screen that exists but omits the Comment field still cannot be detected; that case is documented rather than warned about.
How to test?
On a workflow whose transitions have no screen (common for simple boards):
Before this change the same command printed only the success line and the comment vanished with no indication. Confirm with
jira issue view ISSUE-1 --comments 5that the comment is indeed absent — that is pre-existing Jira behavior, unchanged by this PR; only the warning is new.On a transition that does have a screen (for example a
Donetransition with a resolution screen), no warning is printed and the comment is applied exactly as before.go test ./pkg/jira/ -run TestTransitionscovers the new field parsing and asserts thatexpand=transitions.fieldsis actually requested — without it,Fieldsis always empty and a screen-less transition becomes indistinguishable from one with a screen.Checklist