feat(issue): add yt issue get-field (YT-8) #51

Merged
David merged 2 commits from feat/issue-get-field-YT-8 into main 2026-05-23 20:41:11 +02:00
Owner

Summary

  • Adds yt issue get-field <ID> <FIELD> to read a single custom-field value: plain mode prints the presentation string and exits 0; --json emits {field, value, type, raw}.
  • Unknown field name exits non-zero; field-exists-but-unset exits 0 with an empty value (matches how callers already treat null custom fields).
  • Driver: claude-bot needs to read the AI Agent custom field after a Claude run; today consumers parse inspect --json, filter customFields[] by name, then dig into value.name. This mirrors the set-state / set-estimation ergonomics.

Closes YT-8.

Test plan

  • yt issue get-field YT-8 State prints In Progress.
  • yt issue get-field YT-8 State --json returns the four-field envelope with the StateBundleElement discriminator.
  • yt issue get-field YT-8 Estimation --json returns value: null for an unset field and exits 0.
  • yt issue get-field YT-8 NonexistentField exits non-zero with a clear error.
  • New unit tests cover enum, null, unknown-field, and the missing-credentials path.
## Summary - Adds `yt issue get-field <ID> <FIELD>` to read a single custom-field value: plain mode prints the presentation string and exits 0; `--json` emits `{field, value, type, raw}`. - Unknown field name exits non-zero; field-exists-but-unset exits 0 with an empty value (matches how callers already treat null custom fields). - Driver: `claude-bot` needs to read the `AI Agent` custom field after a Claude run; today consumers parse `inspect --json`, filter `customFields[]` by name, then dig into `value.name`. This mirrors the `set-state` / `set-estimation` ergonomics. Closes YT-8. ## Test plan - [ ] `yt issue get-field YT-8 State` prints `In Progress`. - [ ] `yt issue get-field YT-8 State --json` returns the four-field envelope with the `StateBundleElement` discriminator. - [ ] `yt issue get-field YT-8 Estimation --json` returns `value: null` for an unset field and exits 0. - [ ] `yt issue get-field YT-8 NonexistentField` exits non-zero with a clear error. - [ ] New unit tests cover enum, null, unknown-field, and the missing-credentials path.
feat(issue): add yt issue get-field (YT-8)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 13s
ef3cb450ae
Adds `yt issue get-field <ID> <FIELD>` to read a single custom-field value. Plain mode prints the presentation string on stdout (`Queued`, `In Progress`, etc.) and exits 0; `--json` emits `{field, value, type, raw}` where `raw` is the original JSON value (lets scripted consumers parse non-string shapes) and `type` is the value's `$type` discriminator. An unknown field name exits non-zero; a known-but-unset field exits 0 with an empty value, matching how data callers already treat null custom fields.

Driver: claude-bot's YouTrack action needs to read the `AI Agent` custom field after a Claude run. Today every consumer has to parse `inspect --json`, filter `customFields[]` by name, then dig into `value.name`. Mirrors the existing `yt issue set-state` / `set-estimation` ergonomics.

#YT-8 State Done
Merge remote-tracking branch 'origin/main' into feat/issue-get-field-YT-8
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
45bbb22233
# Conflicts:
#	src/yt/api.rs
David merged commit 95617007e5 into main 2026-05-23 20:41:11 +02:00
David deleted branch feat/issue-get-field-YT-8 2026-05-23 20:41:12 +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!51
No description provided.