Skip to content

Jira issue-link inward/outward direction is inverted in read and write paths #162

Description

@studykit

Summary

The Jira provider maps issue-link direction backwards relative to Atlassian's issue-linking model, in which the inwardIssue of a link performs the link type's outward verb (e.g. for "Blocks": inwardIssue blocks, outwardIssue is blocked by).

Impact

  • Write (create_issue_link, scripts/issue/jira/provider.py): a mapping direction == "outward" placed the source issue in outwardIssue instead of inwardIssue, so links were created with their direction inverted (e.g. marking A as blocking B recorded A as blocked by B).
  • Read (_issue_link_target_and_label, scripts/issue/jira/relationships.py): the populated-side direction was inverted on read-back, so relationships rendered with the wrong verb (e.g. "Blocks: TEST-2000 (inward)" instead of "(outward)").

Fix

  • In create_issue_link, put the source in inwardIssue for direction == "outward" and in outwardIssue for direction == "inward".
  • In _issue_link_target_and_label, return the populated field's own direction (outward_issue"outward", inward_issue"inward").
  • Update Jira fixture/assertion shapes in tests/test_jira_issue_provider.py and tests/test_jira_issue_cache.py to match real Atlassian GET/POST payloads.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions