feat(work-items): add --parent flag to create and update

What does this MR do?

Adds --parent to glab work-items create and glab work-items update, so child items no longer need a raw glab api graphql call.

--parent accepts:

  • an ID in the current scope: 42 or #42
  • a reference: group/project#42, or group&7 for an epic
  • a URL: .../-/work_items/42, .../-/issues/42, /groups/<group>/-/work_items/7, or /groups/<group>/-/epics/7

The command resolves the parent's global ID with GetWorkItem and passes it as ParentID, which client-go sends as hierarchyWidget.parentId.

glab work-items create --type task --title "Write tests" --parent 8342
glab work-items update 8640 --parent gitlab-org/cli#8342

The parent is resolved before any --attach uploads, so a bad --parent fails without leaving orphaned uploads. A malformed reference returns a flag error.

Clearing a parent is out of scope.

Supersedes !4153 (closed).

Closes #8642 (closed)

🤖 Generated with Claude Code

Merge request reports

Loading
Loading