From 4ad02bc83216ce7d14400e7bde941b8299a449a0 Mon Sep 17 00:00:00 2001 From: Tim <32556895+Avarei@users.noreply.github.com> Date: Thu, 23 Jun 2022 08:00:24 +0200 Subject: [PATCH] feat: Add sprint goal Adds the Goal field to the Sprint struct --- board.go | 1 + board_test.go | 4 ++-- mocks/sprints.json | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/board.go b/board.go index 890d6e0a..1f457582 100644 --- a/board.go +++ b/board.go @@ -73,6 +73,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 diff --git a/board_test.go b/board_test.go index 11a5dc2d..1fd64847 100644 --- a/board_test.go +++ b/board_test.go @@ -181,8 +181,8 @@ func TestBoardService_GetAllSprints(t *testing.T) { t.Error("Expected sprint list. Got nil.") } - if len(sprints) != 4 { - t.Errorf("Expected 4 transitions. Got %d", len(sprints)) + if len(sprints) != 6 { + t.Errorf("Expected 6 transitions. Got %d", len(sprints)) } } diff --git a/mocks/sprints.json b/mocks/sprints.json index 508ca35b..ad57cb82 100644 --- a/mocks/sprints.json +++ b/mocks/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" } ] }