mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-04-13 11:40:36 +02:00
add names into issue return
This commit is contained in:
parent
f1fe71fa2d
commit
91c5e6ee84
12
issue.go
12
issue.go
@ -1059,7 +1059,7 @@ func (s *IssueService) AddLink(issueLink *IssueLink) (*Response, error) {
|
|||||||
// SearchWithContext will search for tickets according to the jql
|
// SearchWithContext will search for tickets according to the jql
|
||||||
//
|
//
|
||||||
// Jira API docs: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues
|
// Jira API docs: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues
|
||||||
func (s *IssueService) SearchWithContext(ctx context.Context, jql string, options *SearchOptions) ([]Issue, *Response, error) {
|
func (s *IssueService) SearchWithContext(ctx context.Context, jql string, options *SearchOptions) ([]Issue, map[string]string, *Response, error) {
|
||||||
u := url.URL{
|
u := url.URL{
|
||||||
Path: "rest/api/2/search",
|
Path: "rest/api/2/search",
|
||||||
}
|
}
|
||||||
@ -1090,7 +1090,7 @@ func (s *IssueService) SearchWithContext(ctx context.Context, jql string, option
|
|||||||
|
|
||||||
req, err := s.client.NewRequestWithContext(ctx, "GET", u.String(), nil)
|
req, err := s.client.NewRequestWithContext(ctx, "GET", u.String(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []Issue{}, nil, err
|
return []Issue{}, map[string]string{}, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
v := new(searchResult)
|
v := new(searchResult)
|
||||||
@ -1098,11 +1098,11 @@ func (s *IssueService) SearchWithContext(ctx context.Context, jql string, option
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
err = NewJiraError(resp, err)
|
err = NewJiraError(resp, err)
|
||||||
}
|
}
|
||||||
return v.Issues, resp, err
|
return v.Issues, v.Names, resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search wraps SearchWithContext using the background context.
|
// Search wraps SearchWithContext using the background context.
|
||||||
func (s *IssueService) Search(jql string, options *SearchOptions) ([]Issue, *Response, error) {
|
func (s *IssueService) Search(jql string, options *SearchOptions) ([]Issue, map[string]string, *Response, error) {
|
||||||
return s.SearchWithContext(context.Background(), jql, options)
|
return s.SearchWithContext(context.Background(), jql, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1121,7 +1121,7 @@ func (s *IssueService) SearchPagesWithContext(ctx context.Context, jql string, o
|
|||||||
options.MaxResults = 50
|
options.MaxResults = 50
|
||||||
}
|
}
|
||||||
|
|
||||||
issues, resp, err := s.SearchWithContext(ctx, jql, options)
|
issues, _, resp, err := s.SearchWithContext(ctx, jql, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1143,7 +1143,7 @@ func (s *IssueService) SearchPagesWithContext(ctx context.Context, jql string, o
|
|||||||
}
|
}
|
||||||
|
|
||||||
options.StartAt += resp.MaxResults
|
options.StartAt += resp.MaxResults
|
||||||
issues, resp, err = s.SearchWithContext(ctx, jql, options)
|
issues, _, resp, err = s.SearchWithContext(ctx, jql, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user