Skip to content

fix(jira): leave an issue alone when Jira hides its assignee (#290) - #337

Merged
baldurpan merged 3 commits into
mainfrom
fix/290-branch-jira-assign-replaces-a-colleagues
Nov 8, 2026
Merged

baldurpan merged 3 commits into
mainfrom
fix/290-branch-jira-assign-replaces-a-colleagues

Conversation

@baldurpan

Copy link
Copy Markdown
Contributor

Closes #290

What changed

worktree branch --jira <KEY> --assign no longer replaces someone else's assignment when the issue's project leaves Assignee out of its field scheme. In that case Jira answers GET /issue/{key}?fields=assignee with no fields object, or with no assignee key, even though the issue can still have an assignee. Before this fix, both answers read as undefined and fell through to the PUT.

  • src/integrations/jira.ts: assignJiraIssue now writes only on "assignee": null, which is a free issue. A missing fields, a fields: null or a missing assignee key returns a new JiraAssignment outcome, assignee-hidden. That check runs before the isMine and held-by-other checks, and nothing is written. Cloud and Data Center are handled the same way.
  • src/commands/branch.ts: the new outcome warns "Jira does not show who holds KEY (its project's field scheme leaves out Assignee), so it was left alone. Assign it in Jira if it should be yours." It is recorded in warnings, the document reports assigned: false, and the worktree is still created. The --help text for assigned names the new reason.
  • Tests: the test that pinned the bug ("treats an issue with no assignee key as unassigned and assigns it") is rewritten to expect assignee-hidden and no PUT. A second test replays the issue's exact site answer ({id, key} with no fields). A branch test checks the warning, assigned: false and that the worktree is created.
  • Docs: the assigned field's description now gives the third reason it can be false, in README.md, docs/.../commands/branch.mdx and skills/worktree/SKILL.md. The Jira guide's Assigning the issue section gains a bullet, and the branch.mdx Jira bullet and the SKILL example comment mention the case too.
  • Release note: .changeset/hidden-assignee-left-alone.md, patch, confirmed. src/** and skills/** each owe a note under context/release.md, and this one covers both. docs/** owes none.

Gates

Gate 1 (from context/verify.md): every command below exited 0.

  • pnpm check
  • pnpm typecheck
  • pnpm --filter docs typecheck
  • pnpm build
  • pnpm docs:build
  • pnpm --filter docs worker:bundle-check
  • pnpm docs:audit-dist (28 pages pass)
  • pnpm test (3807 passed)
  • pnpm docs:test (748 passed)
  • the test-markers grep

Gate 2 used the bundled reviewer subagent. It needed one loopback:

  • Loop 1: FAIL. One blocking item: four places that document --json assigned still listed only two reasons it could be false. Those were README.md, commands/branch.mdx, skills/worktree/SKILL.md and the --help text. All four are fixed.
  • Loop 2: PASS WITH NOTES. Nothing was blocking.

Non-blocking notes that were not acted on:

  • fields: null and the Data Center path have no hidden-assignee test of their own. The code handles both.
  • In commands/branch.mdx, the new "So is an issue whose assignee Jira does not show…" sentence follows the "already yours" sentence, so "So is" can be misread.
  • The short --assign flag summaries (README.md:333, branch.ts:156) still mention only the held-by-someone-else case.
  • The --help wording "a Jira assignee Jira hides" repeats "Jira".
  • "Field scheme" is the Cloud term. Data Center calls it a field configuration.

The coder ran in-host, not as a subagent.

A project whose field scheme leaves out Assignee answers
GET /issue/{key}?fields=assignee with no `fields` object, or with no
`assignee` key, even when someone holds the issue. assignJiraIssue read
that as unassigned and wrote the caller over a colleague. `assignee: null`
is now the only answer that lets the write through; a missing key returns
the new `assignee-hidden` outcome, which warns, writes nothing, reports
`assigned: false` and still creates the worktree.

Closes #290
@baldurpan baldurpan added the bug Something isn't working label Nov 8, 2026

@baldurs-reviewer baldurs-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-reviewer: minor issues

This makes assignJiraIssue write only when Jira answers "assignee": null. A missing fields, a fields: null or a missing assignee key now returns a new assignee-hidden outcome, which branch turns into a warning with assigned: false; docs, help text, tests and a changeset are updated to match. The core check is correct: the explicit !== null guard covers typeof null === "object", and the hidden check runs before anything can reach the PUT. I found nothing blocking: one doc sentence says the wrong thing, and one cheap test is missing.


Reviewed 984ca24 for baldurpan · claude-opus-5-5 · 9 files · $0.55

Comment thread src/integrations/jira.test.ts Resolved
…signee (#290)

Also reword the branch page's hidden-assignee sentence so it no longer
reads as if the issue were reported as already yours.

@baldurs-reviewer baldurs-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-reviewer follow-up: looks good

Since my last review, the branch.mdx sentence about a hidden assignee is now a standalone sentence that says the issue is left alone and reports assigned: false. The tests add a fields: null case beside the no-fields case and a Data Center hidden-assignee test. Both earlier comments are dealt with, the new tests exercise the right paths, and I have nothing further to raise.

Earlier comments


Reviewed 5af06fb (changes since 984ca24) for baldurpan · claude-opus-5-5 · 2 files · $0.35

@baldurpan
baldurpan merged commit 97a2986 into main Nov 8, 2026
2 checks passed
@baldurpan
baldurpan deleted the fix/290-branch-jira-assign-replaces-a-colleagues branch November 8, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

branch --jira --assign replaces a colleague's assignment when the project's field scheme leaves out Assignee

1 participant