feat(list): flatten custom fields in --json output #39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/list-flatten-custom-fields"
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?
Summary
yt list --jsonpreviously serialized each issue with the rawcustomFieldsarray, which renders innu | from jsonas an unreadable list of{name, value}records (per attached screenshot).idReadable,summary, andsprints, with the value rendered via the same presentation logic the text table uses (State-> "In Review",Assignee-> "NiceGuyIT", etc.). The result is one nushell column per field.--custom-fieldsflag appends the originalcustomFieldsarray to each row in addition to the flattened keys (not as a replacement), for callers that need the raw structure (e.g. enum bundle ids, full assignee object).idReadable/summary/sprints/customFieldsare skipped so they cannot shadow the built-in row keys.serde_json'spreserve_orderfeature so the JSON key order is stable (idReadable,summary, custom fields in server order,sprints, optionalcustomFields) instead of the alphabetical order BTreeMap would otherwise produce.Test plan
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo test --all-targets(212 passed; three new tests cover flatten ordering, the--custom-fieldsflag, and shadow-key skipping)yt list --query "#Unresolved for:me" --json | from jsonshows one column per custom field; rerun with--custom-fieldsto confirm the raw array is appended.