Skip to content

fix(bitwarden-atlassian-tools): create link_issues Blocks links in the requested direction - #286

Merged
keithhubner merged 2 commits into
mainfrom
fix/link-issues-blocks-direction
Oct 22, 2026
Merged

keithhubner merged 2 commits into
mainfrom
fix/link-issues-blocks-direction

Conversation

@keithhubner

Copy link
Copy Markdown
Contributor

🎟️ Tracking

Found on 2026-10-21 while correcting the dependency links on SHOT-295. link_issues created SHOT-295/297, 297/298 and 297/299 inverted on 2026-09-23, and reproduced the fault live on 2026-10-21 (link 88495).

📔 Objective

link_issues with linkType: Blocks, blockerKey: A, blockedKey: B replied "Linked: A blocks B. Verified: …", but Jira stored B blocks A. Every Blocks link the tool has created is inverted.

Root cause. The ground-truth example in createIssueLink's doc comment (PM-39203 / PM-38796) was read backwards. On issue X's record, inwardIssue: Y reads "X is blocked by Y" and outwardIssue: Y reads "X blocks Y", so that link is PM-38796 blocks PM-39203. The create mapping followed the misreading and put the blocker on outwardIssue. verifyLink reused the same mapping, so an inverted link always passed as verified, and the handler test mocked a GET shape that followed the same model.

Fix.

  • resolveLinkDirection: for Blocks, blocker → inwardIssue, blocked → outwardIssue. Verified live: posting inwardIssue: SHOT-295, outwardIssue: SHOT-297 created link 88496, which reads SHOT-295 blocks SHOT-297 from both ends. The dry-run payload is built from the same object.
  • verifyLink checks by role, independent of the create mapping. It reads the blocker and requires a Blocks entry with outwardIssue: blocked. If it finds inwardIssue: blocked instead, it reports the link as created inverted with its id. Links of another type no longer count. Relates is accepted from either side.
  • Corrected the doc comments on createIssueLink and JiraIssueLink, and dropped the unverified claim that the REST mapping is the opposite of acli's --in/--out.
  • Tests use the read-back shape Jira actually returns, assert the POST and dry-run payloads, and cover an inverted read-back.
  • Patch bump 2.7.6 → 2.7.7 (plugin.json, marketplace.json, root README).

⚠️ Every Blocks link created with link_issues before 2.7.7 is inverted. The CHANGELOG entry tells users to check each one, delete it, and recreate it. Relates links are unaffected.

🤖 Generated with Claude Code

…e requested direction

link_issues put the blocker on outwardIssue, so every Blocks link it
created read the opposite way round in Jira. The mapping came from a
misreading of a live link's GET response, and the read-back check reused
the same mapping, so inverted links were reported as verified.

Put the blocker on inwardIssue, and verify by role from the blocker's
record so a wrong mapping cannot pass its own check. An inverted link is
now reported as such, with its link id.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@keithhubner keithhubner added the ai-review Request a Claude code review label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR fixes link_issues so that Blocks links are created in the requested direction. The blocker now goes on inwardIssue and the blocked item on outwardIssue, and the dry-run payload is built from the same mapping. verifyLink now checks each issue by its role, separately from the create mapping, and reports a link that landed inverted along with its link id. Since the last review, the createIssueLink doc comment has been corrected to read <outward description>, which resolves the earlier thread. The read-back semantics still match how get-issue.ts renders issuelinks, and the 2.7.7 version bump and CHANGELOG entry are consistent.

@keithhubner
keithhubner marked this pull request as ready for review October 22, 2026 09:39
@keithhubner
keithhubner requested a review from a team as a code owner October 22, 2026 09:39
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@keithhubner
keithhubner merged commit a5ac14e into main Oct 22, 2026
30 checks passed
@keithhubner
keithhubner deleted the fix/link-issues-blocks-direction branch October 22, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants