1
0
mirror of https://github.com/strongdm/comply synced 2024-07-02 23:14:22 +00:00
comply/vendor/github.com/andygrunwald/go-jira/resolution.go
Justin McCarthy 7468711b3b
go.mod: update gitlab dep to v0.30.1
Releases after github.com/xanzy/go-gitlab@v0.31.0 introduce breaking
changes to the NewClient call.

Addresses #94
2020-09-14 11:31:56 -07:00

36 lines
1.1 KiB
Go

package jira
// ResolutionService handles resolutions for the JIRA instance / API.
//
// JIRA API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Resolution
type ResolutionService struct {
client *Client
}
// Resolution represents a resolution of a JIRA issue.
// Typical types are "Fixed", "Suspended", "Won't Fix", ...
type Resolution struct {
Self string `json:"self" structs:"self"`
ID string `json:"id" structs:"id"`
Description string `json:"description" structs:"description"`
Name string `json:"name" structs:"name"`
}
// GetList gets all resolutions from JIRA
//
// JIRA API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-resolution-get
func (s *ResolutionService) GetList() ([]Resolution, *Response, error) {
apiEndpoint := "rest/api/2/resolution"
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
if err != nil {
return nil, nil, err
}
resolutionList := []Resolution{}
resp, err := s.client.Do(req, &resolutionList)
if err != nil {
return nil, resp, NewJiraError(resp, err)
}
return resolutionList, resp, nil
}