mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-27 00:21:07 +02:00
Merge pull request #68 from wvell/master
Adds support for selecting specific fields from the jira api. See https://docs.atlassian.com/jira/REST/cloud/#api/2/search-search for details
This commit is contained in:
5
issue.go
5
issue.go
@ -436,6 +436,7 @@ type SearchOptions struct {
|
|||||||
MaxResults int `url:"maxResults,omitempty"`
|
MaxResults int `url:"maxResults,omitempty"`
|
||||||
// Expand: Expand specific sections in the returned issues
|
// Expand: Expand specific sections in the returned issues
|
||||||
Expand string `url:"expand,omitempty"`
|
Expand string `url:"expand,omitempty"`
|
||||||
|
Fields []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// searchResult is only a small wrapper around the Search (with JQL) method
|
// searchResult is only a small wrapper around the Search (with JQL) method
|
||||||
@ -622,8 +623,8 @@ func (s *IssueService) Search(jql string, options *SearchOptions) ([]Issue, *Res
|
|||||||
if options == nil {
|
if options == nil {
|
||||||
u = fmt.Sprintf("rest/api/2/search?jql=%s", url.QueryEscape(jql))
|
u = fmt.Sprintf("rest/api/2/search?jql=%s", url.QueryEscape(jql))
|
||||||
} else {
|
} else {
|
||||||
u = fmt.Sprintf("rest/api/2/search?jql=%s&startAt=%d&maxResults=%d&expand=%s", url.QueryEscape(jql),
|
u = fmt.Sprintf("rest/api/2/search?jql=%s&startAt=%d&maxResults=%d&expand=%s&fields=%s", url.QueryEscape(jql),
|
||||||
options.StartAt, options.MaxResults, options.Expand)
|
options.StartAt, options.MaxResults, options.Expand, strings.Join(options.Fields, ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := s.client.NewRequest("GET", u, nil)
|
req, err := s.client.NewRequest("GET", u, nil)
|
||||||
|
Reference in New Issue
Block a user