diff --git a/cloud/board.go b/cloud/board.go index 264779bb..1505831d 100644 --- a/cloud/board.go +++ b/cloud/board.go @@ -84,6 +84,7 @@ type Sprint struct { OriginBoardID int `json:"originBoardId" structs:"originBoardId"` Self string `json:"self" structs:"self"` State string `json:"state" structs:"state"` + Goal string `json:"goal,omitempty" structs:"goal"` } // BoardConfiguration represents a boardConfiguration of a jira board @@ -240,10 +241,7 @@ func (s *BoardService) DeleteBoard(ctx context.Context, boardID int) (*Board, *R // This only includes sprints that the user has permission to view. // // Jira API docs: https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-sprint-get -// -// TODO Double check this method if this works as expected, is using the latest API and the response is complete -// This double check effort is done for v2 - Remove this two lines if this is completed. -func (s *BoardService) GetAllSprints(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error) { +func (s *BoardService) GetAllSprints(ctx context.Context, boardID int64, options *GetAllSprintsOptions) (*SprintsList, *Response, error) { apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%d/sprint", boardID) url, err := addOptions(apiEndpoint, options) if err != nil { diff --git a/testing/mock-data/sprints.json b/testing/mock-data/sprints.json index 508ca35b..ad57cb82 100644 --- a/testing/mock-data/sprints.json +++ b/testing/mock-data/sprints.json @@ -41,6 +41,21 @@ "self": "https://jira.com/rest/agile/1.0/sprint/832", "startDate": "2016-06-20T13:24:39.161-07:00", "state": "active" + }, + { + "id": 845, + "self":"https://jira.com/rest/agile/1.0/sprint/845", + "state": "future", + "name": "Minimal Example Sprint", + "originBoardId": 734 + }, + { + "id": 846, + "self": "https://jira.com/rest/agile/1.0/sprint/846", + "state": "future", + "name": "Sprint with a Goal", + "originBoardId": 734, + "goal": "My Goal" } ] } diff --git a/testing/mock-data/sprints_filtered.json b/testing/mock-data/sprints_filtered.json index 29bdb230..5cb0a700 100644 --- a/testing/mock-data/sprints_filtered.json +++ b/testing/mock-data/sprints_filtered.json @@ -10,7 +10,8 @@ "originBoardId": 734, "self": "https://jira.com/rest/agile/1.0/sprint/832", "startDate": "2016-06-20T13:24:39.161-07:00", - "state": "active" + "state": "active", + "goal": "My Goal" } ] }