feat(workitems): Implement UpdateWorkItem()

What does this MR do and why?

Implements UpdateWorkItem() on WorkItemsService, resolving #2221 (closed).

The method accepts a fullPath and iid (matching the conventions of GetWorkItem and ListWorkItems), performs an internal GID lookup via a new workItemGID() helper, and then issues a workItemUpdate GraphQL mutation.

UpdateWorkItemOptions is brought to feature parity with CreateWorkItemOptions, supporting all fields that can be set on creation:

Option Widget
Title, StateEvent top-level mutation input
Description descriptionWidget
AssigneeIDs assigneesWidget
MilestoneID milestoneWidget
CRMContactIDs crmContactsWidget (always REPLACE mode)
ParentID hierarchyWidget
AddLabelIDs, RemoveLabelIDs labelsWidget
StartDate, DueDate startAndDueDateWidget
Weight weightWidget
HealthStatus healthStatusWidget
IterationID iterationWidget
Color colorWidget
Status statusWidget

Several update-specific GQL input types are introduced where the GraphQL API requires a different shape than the create path (e.g. workItemWidgetLabelsUpdateInputGQL uses addLabelIds/removeLabelIds rather than a single set).

Also adds:

  • WorkItemStatusID type and constants for the five system-defined statuses (ToDo, InProgress, Done, WontDo, Duplicate)
  • WorkItemStateEvent type and CLOSE/REOPEN constants (previously untyped)
  • gidGQL.IsZero() helper used to detect a missing work item in the ID-lookup response
  • updateWorkItemTemplate for the mutation query, following the same template-chaining pattern as createWorkItemTemplate
  • A TestUpdateWorkItem table-driven test covering: a simple title update, all options at once, not-found during ID lookup, null work item in mutation response, and a mutation-level error

All exported symbols carry the standard experimental API warning.

Edited by Florian Forster

Merge request reports

Loading