-
Notifications
You must be signed in to change notification settings - Fork 1
fix(jtk): issues search -o json omits custom fields #179
Copy link
Copy link
Closed
Description
Problem
jtk issues search --jql '...' -o json returns null for all custom fields, even when those fields have values on the tickets. This forces users to drop down to raw curl calls against the Jira REST API for any query that needs custom field data.
The inconsistency:
| Command | Custom fields in JSON? |
|---|---|
jtk issue get <key> -o json |
Yes |
jtk sprints issues <id> -o json |
Yes |
jtk issues search --jql '...' -o json |
No — all null |
Reproduction
# Single ticket — custom fields present
jtk issue get MON-4036 -o json | jq '{sp: .fields.customfield_10035, changeType: .fields.customfield_10005}'
# => {"sp": 3.0, "changeType": {"value": "Feature", ...}}
# JQL search — custom fields null
jtk issues search --jql 'key = MON-4036' -o json | jq '.[0] | {sp: .fields.customfield_10035, changeType: .fields.customfield_10005}'
# => {"sp": null, "changeType": null}Root Cause (likely)
The Jira REST API search endpoint accepts a fields parameter to control which fields are returned. If issues search isn't passing custom fields in that parameter (or is using a hardcoded field list that only includes built-in fields), the API won't return them.
Proposed Fix
- Pass custom fields through: If the search endpoint supports a
--fieldsflag, include custom fields. If not, don't restrict thefieldsparameter so Jira returns everything. - Bonus: Add a
--fieldsflag tojtk issues searchso users can specify exactly which fields they want (mirrors the REST API'sfieldsparameter). Example:jtk issues search --jql '...' --fields key,summary,customfield_10005,customfield_10035 -o json
Version
jtk version 1.0.43
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels