1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-02-09 13:36:58 +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"` Issues []string `json:"issues"`
} }
// Wrapper struct for search result // IssuesInSprintResult represents a wrapper struct for search result
type IssuesInSprintResult struct { type IssuesInSprintResult struct {
Issues []Issue `json:"issues"` Issues []Issue `json:"issues"`
} }
@ -40,10 +40,12 @@ func (s *SprintService) MoveIssuesToSprint(sprintID int, issueIDs []string) (*Re
return resp, err 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 // JIRA API Docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-getIssuesForSprint
func (s *SprintService) GetIssuesInSprint(sprintID int) ([]Issue, *Response, error) { func (s *SprintService) GetIssuesForSprint(sprintID int) ([]Issue, *Response, error) {
apiEndpoint := fmt.Sprintf("rest/agile/1.0/sprint/%d/issue", sprintID) apiEndpoint := fmt.Sprintf("rest/agile/1.0/sprint/%d/issue", sprintID)
req, err := s.client.NewRequest("GET", apiEndpoint, nil) 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() setup()
defer teardown() defer teardown()
testAPIEdpoint := "/rest/agile/1.0/sprint/123/issue" testAPIEdpoint := "/rest/agile/1.0/sprint/123/issue"
@ -53,7 +53,7 @@ func TestSprintService_GetIssuesInSprint(t *testing.T) {
fmt.Fprint(w, string(raw)) fmt.Fprint(w, string(raw))
}) })
issues, _, err := testClient.Sprint.GetIssuesInSprint(123) issues, _, err := testClient.Sprint.GetIssuesForSprint(123)
if err != nil { if err != nil {
t.Errorf("Error given: %v", err) t.Errorf("Error given: %v", err)
} }