Skip to content

Commit c7a7410

Browse files
committed
Cloud/Board: Add Sprint goal
Thanks goes to @avarei for his work in #463
1 parent 76785ff commit c7a7410

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

cloud/board.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type Sprint struct {
8484
OriginBoardID int `json:"originBoardId" structs:"originBoardId"`
8585
Self string `json:"self" structs:"self"`
8686
State string `json:"state" structs:"state"`
87+
Goal string `json:"goal,omitempty" structs:"goal"`
8788
}
8889

8990
// BoardConfiguration represents a boardConfiguration of a jira board
@@ -240,10 +241,7 @@ func (s *BoardService) DeleteBoard(ctx context.Context, boardID int) (*Board, *R
240241
// This only includes sprints that the user has permission to view.
241242
//
242243
// Jira API docs: https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-sprint-get
243-
//
244-
// TODO Double check this method if this works as expected, is using the latest API and the response is complete
245-
// This double check effort is done for v2 - Remove this two lines if this is completed.
246-
func (s *BoardService) GetAllSprints(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error) {
244+
func (s *BoardService) GetAllSprints(ctx context.Context, boardID int64, options *GetAllSprintsOptions) (*SprintsList, *Response, error) {
247245
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%d/sprint", boardID)
248246
url, err := addOptions(apiEndpoint, options)
249247
if err != nil {

testing/mock-data/sprints.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@
4141
"self": "https://jira.com/rest/agile/1.0/sprint/832",
4242
"startDate": "2016-06-20T13:24:39.161-07:00",
4343
"state": "active"
44+
},
45+
{
46+
"id": 845,
47+
"self":"https://jira.com/rest/agile/1.0/sprint/845",
48+
"state": "future",
49+
"name": "Minimal Example Sprint",
50+
"originBoardId": 734
51+
},
52+
{
53+
"id": 846,
54+
"self": "https://jira.com/rest/agile/1.0/sprint/846",
55+
"state": "future",
56+
"name": "Sprint with a Goal",
57+
"originBoardId": 734,
58+
"goal": "My Goal"
4459
}
4560
]
4661
}

testing/mock-data/sprints_filtered.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"originBoardId": 734,
1111
"self": "https://jira.com/rest/agile/1.0/sprint/832",
1212
"startDate": "2016-06-20T13:24:39.161-07:00",
13-
"state": "active"
13+
"state": "active",
14+
"goal": "My Goal"
1415
}
1516
]
1617
}

0 commit comments

Comments
 (0)