1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-02-03 13:11:49 +02:00

Renamed API method to (like JIRA API) and fixed go doc

This commit is contained in:
Andy Grunwald 2016-07-29 19:43:34 +02:00
parent cb95457e3f
commit 5a0fb0ba05
2 changed files with 8 additions and 6 deletions

View File

@ -15,7 +15,7 @@ type IssuesWrapper struct {
Issues []string `json:"issues"`
}
// Wrapper struct for search result
// IssuesInSprintResult represents a wrapper struct for search result
type IssuesInSprintResult struct {
Issues []Issue `json:"issues"`
}
@ -40,10 +40,12 @@ func (s *SprintService) MoveIssuesToSprint(sprintID int, issueIDs []string) (*Re
return resp, err
}
// For a given sprint Id, return all issues currently associated with that sprint
// GetIssuesForSprint returns all issues in a sprint, for a given sprint Id.
// This only includes issues that the user has permission to view.
// By default, the returned issues are ordered by rank.
//
// JIRA API Docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint-getIssuesForSprint
func (s *SprintService) GetIssuesInSprint(sprintID int) ([]Issue, *Response, error) {
// JIRA API Docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-getIssuesForSprint
func (s *SprintService) GetIssuesForSprint(sprintID int) ([]Issue, *Response, error) {
apiEndpoint := fmt.Sprintf("rest/agile/1.0/sprint/%d/issue", sprintID)
req, err := s.client.NewRequest("GET", apiEndpoint, nil)

View File

@ -38,7 +38,7 @@ func TestSprintService_MoveIssuesToSprint(t *testing.T) {
}
}
func TestSprintService_GetIssuesInSprint(t *testing.T) {
func TestSprintService_GetIssuesForSprint(t *testing.T) {
setup()
defer teardown()
testAPIEdpoint := "/rest/agile/1.0/sprint/123/issue"
@ -53,7 +53,7 @@ func TestSprintService_GetIssuesInSprint(t *testing.T) {
fmt.Fprint(w, string(raw))
})
issues, _, err := testClient.Sprint.GetIssuesInSprint(123)
issues, _, err := testClient.Sprint.GetIssuesForSprint(123)
if err != nil {
t.Errorf("Error given: %v", err)
}