Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Add summary support in AddSpentTimeOptions #1818

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions time_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading