Skip to content

feat(issue): add related, add-related and remove-related commands - #172

Open
lollipop-onl wants to merge 2 commits into
lollipop-onl/feat-document-commandsfrom
lollipop-onl/feat-issue-related
Open

lollipop-onl wants to merge 2 commits into
lollipop-onl/feat-document-commandsfrom
lollipop-onl/feat-issue-related

Conversation

@lollipop-onl

@lollipop-onl lollipop-onl commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #170 — the regenerated Skill command table re-pads every row, so this can't merge independently of it. The base will move to main once #170 merges.

Summary

Adds commands for related issues. backlog-js already wraps the endpoints, but bee only reached them through bee api, which needs the target's numeric issue ID rather than its key.

Command Endpoint
bee issue related <issue> GET /issues/:issueIdOrKey/relatedIssues
bee issue add-related <issue> <targets...> POST /issues/:issueIdOrKey/relatedIssues (targetIssueId)
bee issue remove-related <issue> <targets...> DELETE /issues/:issueIdOrKey/relatedIssues/:relatedIssueId
  • Targets accept issue keys or IDs. The new resolveIssueId in @repo/backlog-utils uses numeric input as-is and otherwise looks it up with getIssue(), next to resolveUserId / resolveProjectIds.
  • The base issue and every target are resolved before any write, so an unknown key changes nothing. Relating an issue to itself is rejected up front, because the API returns 200 and does nothing. Writes then go one at a time, each reported with the key from the response, so an API error part-way still shows what changed. --json prints the responses instead.
  • Both POST and DELETE return the target issue, and :relatedIssueId is the target's ID. The public reference does not say either; both were confirmed on a live space and against the server implementation.
  • The naming follows project users / add-user / remove-user and document add-tag / remove-tag (feat(document): add comments, count, add-tag and remove-tag commands #170).

Test plan

  • vp check passes
  • vp test: all tests pass, including resolve-issue.test.ts and the three command tests
  • vp run --filter @nulab/bee generate:skill:check passes
  • Live space: list (both sides), relate by key and by ID, self-relation rejected, unknown key rejected with no relation created, remove by key and by ID, removing a non-relation errors; test issues deleted afterwards

🤖 Generated with Claude Code

lollipop-onl and others added 2 commits September 29, 2026 02:41
Backlog added related issues, and backlog-js already wraps the endpoints,
but bee only reached them through `bee api`. That path needs the target's
numeric issue ID rather than its key, which agents and users kept getting
wrong.

The commands accept issue keys or IDs for both sides and resolve targets
one at a time, reporting each as it lands, so a failure part-way through
still shows which relations were already changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trying the commands against a real space showed three problems. A target
key that did not exist failed only after the earlier targets had already
been related, leaving the change half-applied. Relating an issue to itself
returns 200 without doing anything, so bee reported a relation that was
never made. And a target given by ID was echoed back as a bare number,
although both endpoints return the target issue and its key.

Every target (and, for add-related, the base issue) is now resolved up
front, self-relations are rejected before any write, and success messages
use the key from the response. `resolveIssueId` also matches `star add` in
only treating plain digits as IDs, and the CLI tests now mock it at the
package boundary instead of re-testing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lollipop-onl
lollipop-onl force-pushed the lollipop-onl/feat-issue-related branch from 8cd542f to 1a22cca Compare September 28, 2026 17:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant