Skip to content

feat: add related issues tools - #168

Merged
katayama8000 merged 1 commit into
mainfrom
feat/related-issues
Jul 28, 2026
Merged

feat: add related issues tools#168
katayama8000 merged 1 commit into
mainfrom
feat/related-issues

Conversation

@katayama8000

Copy link
Copy Markdown
Collaborator

Summary

Adds tools for the related issues API to the issue toolset, backed by the client methods that shipped in backlog-js v0.19.0 (nulab/backlog-js#181).

Tool Endpoint
get_related_issues GET /api/v2/issues/:issueIdOrKey/relatedIssues
add_related_issue POST /api/v2/issues/:issueIdOrKey/relatedIssues
remove_related_issue DELETE /api/v2/issues/:issueIdOrKey/relatedIssues/:relatedIssueId
  • Bumps backlog-js to ^0.19.0.
  • Adds RelatedIssueSchema — an issue plus the type field the API returns alongside it.
  • All three tools accept issueId / issueKey through the existing resolveIdOrKey helper, consistent with the other issue tools.

Scope

The API currently supports only a single, undirected relation type, so the tools intentionally expose no relation-type argument and RelatedIssueSchema.type is a plain string rather than an enum. This keeps the tool surface to what the API actually supports today, so nothing has to change here when the relation model is extended.

add_related_issue takes a numeric targetIssueId because that is what the endpoint accepts. Resolving a target issue key to an ID would need an extra getIssue call, so it is left out for now and can be added if it turns out agents need it.

Verification

  • Unit tests for all three tools (12 cases): return value shape, issueKey / issueId pass-through, and the error when neither is given.
  • Full suite: 419 tests pass. typecheck, typecheck:all, lint and format are clean.
  • The tool handlers were also run against a real Backlog space, confirming the tools return the related issue with type: "RELATES" and that remove_related_issue / add_related_issue round-trip correctly.

🤖 Generated with Claude Code

Adds three tools to the `issue` toolset, backed by the related issues
endpoints that shipped in backlog-js 0.19.0:

- get_related_issues
- add_related_issue
- remove_related_issue

The API only supports the single undirected relation type today, so the
tools take no relation-type argument; `RelatedIssueSchema` is an issue plus
the `type` field the API returns.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@katayama8000
katayama8000 merged commit ff68c38 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant