Loading workitems.go +10 −0 Original line number Diff line number Diff line Loading @@ -978,6 +978,9 @@ type CreateWorkItemOptions struct { // Color of the work item, represented as a hex code or named color. Example: "#fefefe" Color *string // Global ID of the work item status. Status *WorkItemStatusID } // CreateWorkItemOptionsLinkedItems represents linked items to be added to a work item. Loading Loading @@ -1011,6 +1014,7 @@ type workItemCreateInputGQL struct { HealthStatusWidget *workItemWidgetHealthStatusInputGQL `json:"healthStatusWidget,omitempty"` IterationWidget *workItemWidgetIterationInputGQL `json:"iterationWidget,omitempty"` ColorWidget *workItemWidgetColorInputGQL `json:"colorWidget,omitempty"` StatusWidget *workItemWidgetStatusInputGQL `json:"statusWidget,omitempty"` } // workItemWidgetAssigneesInputGQL represents the assignees widget input. Loading Loading @@ -1204,6 +1208,12 @@ func (opt *CreateWorkItemOptions) wrap(namespacePath string, workItemTypeID Work } } if opt.Status != nil { input.StatusWidget = &workItemWidgetStatusInputGQL{ Status: opt.Status, } } return input } Loading workitems_test.go +6 −2 Original line number Diff line number Diff line Loading @@ -760,6 +760,9 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { "colorWidget": map[string]any{ "color": "#FF0000", }, "statusWidget": map[string]any{ "status": "gid://gitlab/WorkItems::Statuses::SystemDefined::Status/2", }, } // GIVEN a CreateWorkItem mutation request with all options set Loading Loading @@ -806,7 +809,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { }, "status": { "status": { "name": "New" "name": "In Progress" } } } Loading Loading @@ -841,6 +844,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { HealthStatus: Ptr("onTrack"), IterationID: Ptr(int64(567)), Color: Ptr("#FF0000"), Status: Ptr(WorkItemStatusInProgress), } // WHEN CreateWorkItem is called with all options Loading @@ -857,7 +861,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { IID: 41, Type: "Issue", State: "OPEN", Status: Ptr("New"), Status: Ptr("In Progress"), Title: "New Issue", Description: "This is a detailed description", CreatedAt: Ptr(time.Date(2026, time.February, 6, 10, 0, 0, 0, time.UTC)), Loading Loading
workitems.go +10 −0 Original line number Diff line number Diff line Loading @@ -978,6 +978,9 @@ type CreateWorkItemOptions struct { // Color of the work item, represented as a hex code or named color. Example: "#fefefe" Color *string // Global ID of the work item status. Status *WorkItemStatusID } // CreateWorkItemOptionsLinkedItems represents linked items to be added to a work item. Loading Loading @@ -1011,6 +1014,7 @@ type workItemCreateInputGQL struct { HealthStatusWidget *workItemWidgetHealthStatusInputGQL `json:"healthStatusWidget,omitempty"` IterationWidget *workItemWidgetIterationInputGQL `json:"iterationWidget,omitempty"` ColorWidget *workItemWidgetColorInputGQL `json:"colorWidget,omitempty"` StatusWidget *workItemWidgetStatusInputGQL `json:"statusWidget,omitempty"` } // workItemWidgetAssigneesInputGQL represents the assignees widget input. Loading Loading @@ -1204,6 +1208,12 @@ func (opt *CreateWorkItemOptions) wrap(namespacePath string, workItemTypeID Work } } if opt.Status != nil { input.StatusWidget = &workItemWidgetStatusInputGQL{ Status: opt.Status, } } return input } Loading
workitems_test.go +6 −2 Original line number Diff line number Diff line Loading @@ -760,6 +760,9 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { "colorWidget": map[string]any{ "color": "#FF0000", }, "statusWidget": map[string]any{ "status": "gid://gitlab/WorkItems::Statuses::SystemDefined::Status/2", }, } // GIVEN a CreateWorkItem mutation request with all options set Loading Loading @@ -806,7 +809,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { }, "status": { "status": { "name": "New" "name": "In Progress" } } } Loading Loading @@ -841,6 +844,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { HealthStatus: Ptr("onTrack"), IterationID: Ptr(int64(567)), Color: Ptr("#FF0000"), Status: Ptr(WorkItemStatusInProgress), } // WHEN CreateWorkItem is called with all options Loading @@ -857,7 +861,7 @@ func TestCreateWorkItem_SuccessfulCreationWithAllOptions(t *testing.T) { IID: 41, Type: "Issue", State: "OPEN", Status: Ptr("New"), Status: Ptr("In Progress"), Title: "New Issue", Description: "This is a detailed description", CreatedAt: Ptr(time.Date(2026, time.February, 6, 10, 0, 0, 0, time.UTC)), Loading