Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IssueLinkType response #8

Merged
merged 1 commit into from
Feb 22, 2024
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
4 changes: 4 additions & 0 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ type IssueLinkType struct {
Outward string `json:"outward" structs:"outward"`
}

type IssueLinkTypeResponse struct {
IssueLinkTypes []IssueLinkType `json:"issueLinkTypes" structs:"issueLinkTypes"`
}

// Comments represents a list of Comment.
type Comments struct {
Comments []*Comment `json:"comments,omitempty" structs:"comments,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions issuelinktype.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ type IssueLinkTypeService struct {
// GetListWithContext gets all of the issue link types from Jira.
//
// Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-get
func (s *IssueLinkTypeService) GetListWithContext(ctx context.Context) ([]IssueLinkType, *Response, error) {
func (s *IssueLinkTypeService) GetListWithContext(ctx context.Context) (*IssueLinkTypeResponse, *Response, error) {
apiEndpoint := "rest/api/2/issueLinkType"
req, err := s.client.NewRequestWithContext(ctx, "GET", apiEndpoint, nil)
if err != nil {
return nil, nil, err
}

linkTypeList := []IssueLinkType{}
linkTypeList := IssueLinkTypeResponse{}
resp, err := s.client.Do(req, &linkTypeList)
if err != nil {
return nil, resp, NewJiraError(resp, err)
}
return linkTypeList, resp, nil
return &linkTypeList, resp, nil
}

// GetList wraps GetListWithContext using the background context.
func (s *IssueLinkTypeService) GetList() ([]IssueLinkType, *Response, error) {
func (s *IssueLinkTypeService) GetList() (*IssueLinkTypeResponse, *Response, error) {
return s.GetListWithContext(context.Background())
}

Expand Down