feat(issue): add yt issue set-field (YT-9) #52

Merged
David merged 2 commits from feat/issue-set-field-YT-9 into main 2026-05-23 20:43:46 +02:00
Owner

Summary

  • Adds yt issue set-field <ID> <FIELD> <VALUE>... for setting any enum-typed custom field. Mirrors set-state ergonomics: multi-word values join with spaces, --dry-run validates without mutating, --json emits a confirmation envelope.
  • Reuses the existing post_with_type_retry discover-on-400 mechanism, so the same command works for State, Type, Priority, and project-defined enums like AI Agent without the caller having to know the YouTrack $type discriminator.
  • Driver: claude-bot needs to transition issues across an AI Agent state machine; today the only path is the YouTrack command language via yt issue apply --command.
  • Scope: single-value enums only. Multi-value enums are deferred per the issue's open question.

Closes YT-9.

Test plan

  • yt issue set-field YT-9 Priority Major round-trips through the API and a follow-up inspect shows the new value.
  • yt --dry-run issue set-field YT-9 Priority Major prints the planned mutation and does not send the POST.
  • yt issue set-field YT-9 AI\ Agent Working works against a project-defined enum field (when present).
  • New unit tests cover single-word, multi-word, JSON, and missing-credentials paths.
## Summary - Adds `yt issue set-field <ID> <FIELD> <VALUE>...` for setting any enum-typed custom field. Mirrors `set-state` ergonomics: multi-word values join with spaces, `--dry-run` validates without mutating, `--json` emits a confirmation envelope. - Reuses the existing `post_with_type_retry` discover-on-400 mechanism, so the same command works for `State`, `Type`, `Priority`, and project-defined enums like `AI Agent` without the caller having to know the YouTrack `$type` discriminator. - Driver: `claude-bot` needs to transition issues across an `AI Agent` state machine; today the only path is the YouTrack command language via `yt issue apply --command`. - Scope: single-value enums only. Multi-value enums are deferred per the issue's open question. Closes YT-9. ## Test plan - [ ] `yt issue set-field YT-9 Priority Major` round-trips through the API and a follow-up inspect shows the new value. - [ ] `yt --dry-run issue set-field YT-9 Priority Major` prints the planned mutation and does not send the POST. - [ ] `yt issue set-field YT-9 AI\ Agent Working` works against a project-defined enum field (when present). - [ ] New unit tests cover single-word, multi-word, JSON, and missing-credentials paths.
feat(issue): add yt issue set-field (YT-9)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 30s
62934b021a
Adds `yt issue set-field <ID> <FIELD> <VALUE>...` for setting any enum-typed custom field on an issue. Mirrors `set-state` ergonomics: multi-word values join with spaces, `--dry-run` validates without mutating, `--json` emits a confirmation envelope. Uses the existing discover-on-400 retry policy from `update_state`, so it works for `State`, `Type`, `Priority`, and project-defined enums like `AI Agent` without the caller having to know the YouTrack `$type` discriminator.

Driver: claude-bot needs to transition issues across an `AI Agent` state machine (`Queued -> Working -> Needs Review` / `Failed`). Today the only way is `yt issue apply --command 'AI Agent Working'`, which forces callers to learn the YouTrack command language for a common operation.

Single-value enums only; multi-value enums (where YouTrack supports them) are deferred per the open question on the issue.

#YT-9 State Done
Merge remote-tracking branch 'origin/main' into feat/issue-set-field-YT-9
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 15s
Create release / Create release from merged PR (pull_request) Has been skipped
6b8bded35d
# Conflicts:
#	src/cli.rs
#	src/commands/issue/mod.rs
David merged commit 4f8e02fb4a into main 2026-05-23 20:43:46 +02:00
David deleted branch feat/issue-set-field-YT-9 2026-05-23 20:43:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/youtrack-cli!52
No description provided.