Skip to content

feat(boards): ✨ Implement azdo boards work-item relation add command - #331

Merged
tmeckel merged 7 commits into
masterfrom
tmeckel/issue272
Aug 15, 2026
Merged

feat(boards): ✨ Implement azdo boards work-item relation add command#331
tmeckel merged 7 commits into
masterfrom
tmeckel/issue272

Conversation

@tmeckel

@tmeckel tmeckel commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Closes #272

Summary

Adds the azdo boards work-item relation add command to attach relations to an existing work item:

  • azdo boards work-item relation add [ORG:]PROJECT/ID --relation-type <name> --target-id <ID> — link other work items
  • --target-url <URL> — attach arbitrary artifact relations (mutually exclusive with --target-id)
  • Relation type names resolve case-insensitively against the organization's relation types (friendly names, e.g. parent, child, related)
  • Multiple targets accepted per flag (repeatable flags and comma-separated values)
  • Table output lists the refreshed relations with friendly type names; --json / --jq / --template supported

Changes

  • feat(boards): shared relation helpers (SplitAndTrimCSV, ResolveRelationType, PopulateFriendlyNames), mirroring the Azure DevOps CLI extension
  • feat(boards): relation command group with add subcommand, wired into boards work-item
  • test(boards): hermetic table-driven tests covering validation, scope parsing, patch construction, output formats, and error paths (mocks under internal/mocks)
  • docs: regenerated command reference

Verification

  • go build ./cmd/azdo/... — OK
  • go vet ./internal/cmd/boards/workitem/... — OK
  • gofumpt — clean
  • golangci-lint (2.12.2) — 0 issues
  • go test ./... — 2205 tests pass

Commits are topologically sorted: shared helpers → add command → relation group → tree wiring → tests → docs.

Adds SplitAndTrimCSV (comma-separated value parsing with empty-element validation) and ResolveRelationType/PopulateFriendlyNames (relation-type name resolution and friendly-name rendering), mirroring the Azure DevOps CLI extension helpers. Foundation for the boards work-item relation subcommands.
Implements 'azdo boards work-item relation add' per issue #272: resolves the relation type to its reference name, converts target work item IDs to URLs, builds /relations/- JSON Patch operations, updates the work item, and renders the refreshed relation list or JSON output.
Introduces the relation command group under boards work-item, wiring the add subcommand.
Registers the relation group in the work-item command tree so the new subcommand is reachable via 'azdo boards work-item relation add'.
Covers relation-type resolution, target ID/URL validation, patch document construction, scope parsing (default and explicit organization), JSON and table output, and error paths, using the mocks under internal/mocks.
Regenerates the command reference: new relation and relation add pages, updated work-item page with relation link, refreshed help reference index.
@tmeckel tmeckel changed the title feat(boards): ✨ add work-item relation add command feat(boards): ✨ Implement azdo boards work-item relation add command Aug 15, 2026
@tmeckel
tmeckel merged commit 4f084bc into master Aug 15, 2026
4 of 5 checks passed
@tmeckel
tmeckel deleted the tmeckel/issue272 branch August 15, 2026 21:38
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.

Implement azdo boards work-item relation add command

1 participant