[Bug]: --fields drops the entire projection when given a field name valid in JQL but not in the payload
- Dominant language
- JavaScript
- Stars
- 17
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
### TWG CLI version
1.2.6
### Operating system
Ubuntu 24.04 (WSL2)
### Command or agent request
```bash
# camelCase: the spelling used in JQL
twg jira workitem bulk-get ABC-1 ABC-2 --fields key,statusCategoryChangedDate -o json
# lowercase: the spelling used in the returned payload
twg jira workitem bulk-get ABC-1 ABC-2 --fields key,statuscategorychangedate -o json
```
### Expected behavior
An unrecognised field name should either be reported, or ignored without affecting the field names that were recognised.
### Actual behavior
camelCase spelling. Exit code 0, no warning, projection dropped entirely:
```
items: 2
keys of items[0].data: ['expand', 'id', 'key', 'self', 'url']
```
lowercase spelling, same items:
```
items: 2
keys of items[0].data: ['expand', 'id', 'key', 'self', 'statuscategorychangedate', 'url']
```
Both spellings are valid in different contexts: `statusCategoryChangedDate` is the JQL spelling, `statuscategorychangedate` is the key in the returned payload. Copying a field name from a JQL clause into `--fields` returns exit code 0 and a non-empty response in which every requested field is missing.
If that projection feeds a locally computed filter or count, the result is 0 matches, which is indistinguishable from a legitimate empty result.
Contributor guide
Research direction
Start by reproducing the `twg jira workitem bulk-get` command with both `--fields` spellings and trace how the CLI builds its projection. Done means an unrecognised field is reported or ignored while recognised fields remain, rather than dropping the entire projection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100