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

Commit

Permalink
Merge pull request #1818 from airclovis/feat-add-time-spent-summary
Browse files Browse the repository at this point in the history
Add summary support in AddSpentTimeOptions
  • Loading branch information
svanharmelen authored Oct 6, 2023
2 parents e104217 + 68d5594 commit 99e75d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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

0 comments on commit 99e75d5

Please sign in to comment.