fix(workitems): send status widget when creating a work item
What does this MR do?
CreateWorkItemOptions had no way to set a work item's status, unlike UpdateWorkItemOptions, which already sends it via the status widget. This adds the same Status field to CreateWorkItemOptions and wraps it into the statusWidget of the create mutation input, mirroring the existing update implementation and the pattern used for every other widget.
Confirmed against GitLab's own GraphQL schema (ee/app/graphql/ee/mutations/work_items/create.rb) that WorkItemCreateInput does accept a status_widget argument, matching what's already implemented for update.
Closes #2282 (closed)
Changes
CreateWorkItemOptions: addStatus *WorkItemStatusIDworkItemCreateInputGQL: addStatusWidget *workItemWidgetStatusInputGQLCreateWorkItemOptions.wrap(): setStatusWidgetwhenStatusis providedTestCreateWorkItem_SuccessfulCreationWithAllOptions: extended to assertstatusWidgetis sent and the resulting work item status is parsed back, using a non-default status (WorkItemStatusInProgress) so the test can't pass by coincidence with the default status
Test plan
-
go build ./... -
go vet ./... -
go test ./...