diff --git a/issues_test.go b/issues_test.go index 102575652..16f52c6a5 100644 --- a/issues_test.go +++ b/issues_test.go @@ -775,10 +775,12 @@ func TestAddSpentTime(t *testing.T) { mux.HandleFunc("/api/v4/projects/1/issues/5/add_spent_time", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodPost) testURL(t, r, "/api/v4/projects/1/issues/5/add_spent_time") + testBody(t, r, `{"duration":"1h","summary":"test"}`) fmt.Fprint(w, `{"human_time_estimate": null, "human_total_time_spent": "1h", "time_estimate": 0, "total_time_spent": 3600}`) }) addSpentTimeOpt := &AddSpentTimeOptions{ Duration: String("1h"), + Summary: String("test"), } timeState, _, err := client.Issues.AddSpentTime("1", 5, addSpentTimeOpt) diff --git a/time_stats.go b/time_stats.go index c1256b965..0ce2d6751 100644 --- a/time_stats.go +++ b/time_stats.go @@ -104,6 +104,7 @@ func (s *timeStatsService) resetTimeEstimate(pid interface{}, entity string, iss // GitLab docs: https://docs.gitlab.com/ee/workflow/time_tracking.html type AddSpentTimeOptions struct { Duration *string `url:"duration,omitempty" json:"duration,omitempty"` + Summary *string `url:"summary,omitempty" json:"summary,omitempty"` } // addSpentTime adds spent time for a single project issue.