atlassian / atlassian/twg-cli

[Bug]: jira workitem update --parent reports success but does not write the field

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### TWG CLI version

1.2.7

### Operating system

Ubuntu 24.04 (WSL2)

### Command or agent request

Given an epic `ABC-1` and a task `ABC-2` whose `parent` is empty:

```bash
twg jira workitem update --id ABC-2 --parent ABC-1 -o json
twg jira workitem get ABC-2 --fields parent -o json
```

### Expected behavior

Either the parent is set, or the command reports that it was not.

### Actual behavior

The update reports success for the `parent` field specifically, and the field is unchanged:

```
data.results: [{"alias": "update_parent", "fieldId": "parent", "success": true}]
data.success: true
exit code: 0
```

```
fields.parent: null
```

The issue changelog records no `parent` change either, so this is not read-after-write lag: nothing was written.

The same field, same value, same subcommand, through the generic field flag, does write:

```bash
twg jira workitem update --id ABC-2 --fields-json '{"parent":{"key":"ABC-1"}}' -o json
```

After this call `fields.parent` is `ABC-1`, and the changelog contains exactly one parent entry, timestamped at this call rather than at the earlier `--parent` one.

The two calls are indistinguishable from their output: the envelopes are identical, `results[].success: true` included. There is no field a caller can inspect to tell the write that happened from the write that did not, which makes this harder to detect than an error would be. Re-reading the field is the only way.

Observed on 7 issues across two days on the same version, all of them silent in the same way.

Impact: an agent reorganising an issue hierarchy gets a success for every call and changes nothing. A caller that trusts the exit code, or even the per-field `success` flag, reports work it did not do.

Workaround: use `--fields-json '{"parent":{"key":"..."}}'` on the same `workitem update`, and re-read the field afterwards.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with `twg jira workitem update --id ABC-2 --parent ABC-1 -o json`, then verify the result with `twg jira workitem get ABC-2 --fields parent -o json` and compare it with the working `--fields-json` command. Trace the `workitem update --parent` path and its `update_parent` result reporting. Done means `--parent` writes the parent or reports failure accurately, with coverage for the command and its success response.

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
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.