diff --git a/api/issue.go b/api/issue.go index 39640911..7e012556 100644 --- a/api/issue.go +++ b/api/issue.go @@ -192,3 +192,29 @@ var LinkIssues = func(client *gitlab.Client, projectID interface{}, issueIDD int return issueLink.SourceIssue, issueLink.TargetIssue, nil } + +var SetIssueTimeEstimate = func(client *gitlab.Client, projectID interface{}, issueIDD int, opts *gitlab.SetTimeEstimateOptions) (*gitlab.TimeStats, error) { + if client == nil { + client = apiClient.Lab() + } + + timeStats, _, err := client.Issues.SetTimeEstimate(projectID, issueIDD, opts) + if err != nil { + return nil, err + } + + return timeStats, nil +} + +var AddIssueTimeSpent = func(client *gitlab.Client, projectID interface{}, issueIDD int, opts *gitlab.AddSpentTimeOptions) (*gitlab.TimeStats, error) { + if client == nil { + client = apiClient.Lab() + } + + timeStats, _, err := client.Issues.AddSpentTime(projectID, issueIDD, opts) + if err != nil { + return nil, err + } + + return timeStats, nil +}