feat(issue): add a clear verb for single-value custom fields #134
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/YT-80-clear-custom-field"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every write path in the repo constructed a non-null
value, so a single-value custom field such asAI Agentcould be set but never returned to its unset state.list_issue_custom_fieldsalready reports a cleared field asnull, so the read side modelled absence correctly while the write side could not produce it.Adds
clear_custom_fieldto youtrack-client: the same POST the set path uses, withvalueas JSON null, routed throughpost_with_type_retryso the discover-on-400$typefallback applies identically. That makes it field-generic rather than enum-specific:AI Agentclears asSingleEnumIssueCustomField,Due Dateclears as the discoveredDateIssueCustomField.post_with_type_retrynow takes&(dyn Fn(&str) -> Value + Sync)so the returned future staysSend, which the MCP tool dispatch requires of every handler it boxes.Exposes it as the MCP
clear_issue_fieldtool and asyt issue clear-field <ISSUE_ID> <FIELD>, which honours the global--dry-runflag and--json. Clearing an already-unset field is a no-op that reports success (nothing reads the current value first); clearing a field the project marks required fails with YouTrack's own 400 body surfaced to the caller rather than a silent success. There is no pre-check for required-ness: that would cost an admin-endpoint round trip on every call, and the admin endpoint is already known to be inaccessible to non-admin tokens.#YT-80