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

Cloud/Board: Add Sprint goal #588

Merged
merged 1 commit into from
Oct 19, 2022
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
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"
}
]
}