Skip to content

Commit

Permalink
Cloud/Board: Add Sprint goal
Browse files Browse the repository at this point in the history
Thanks goes to @Avarei for his work in #463
  • Loading branch information
andygrunwald committed Oct 19, 2022
1 parent 76785ff commit c7a7410
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cloud/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions testing/mock-data/sprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
3 changes: 2 additions & 1 deletion testing/mock-data/sprints_filtered.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}

0 comments on commit c7a7410

Please sign in to comment.