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

Add expand for list #461

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions jiracmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func CmdListUsage(cmd *kingpin.CmdClause, opts *ListOptions, fig *figtree.FigTre
}).String()
cmd.Flag("query", "Jira Query Language (JQL) expression for the search").Short('q').StringVar(&opts.Query)
cmd.Flag("queryfields", "Fields that are used in \"list\" template").Short('f').StringVar(&opts.QueryFields)
cmd.Flag("expand", "field to expand for list").StringsVar(&opts.Expand)
cmd.Flag("reporter", "Reporter to search for").Short('r').StringVar(&opts.Reporter)
cmd.Flag("status", "Filter on issue status").Short('S').StringVar(&opts.Status)
cmd.Flag("sort", "Sort order to return").Short('s').StringVar(&opts.Sort)
Expand Down
1 change: 1 addition & 0 deletions jiradata/SearchRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ type SearchRequest struct {
Properties Properties `json:"properties,omitempty" yaml:"properties,omitempty"`
StartAt int `json:"startAt,omitempty" yaml:"startAt,omitempty"`
ValidateQuery string `json:"validateQuery,omitempty" yaml:"validateQuery,omitempty"`
Expand []string `yaml:"expand,omitempty" json:"expand,omitempty"`
}
5 changes: 5 additions & 0 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type SearchOptions struct {
Assignee string `yaml:"assignee,omitempty" json:"assignee,omitempty"`
Query string `yaml:"query,omitempty" json:"query,omitempty"`
QueryFields string `yaml:"query-fields,omitempty" json:"query-fields,omitempty"`
Expand string `yaml:"expand,omitempty" json:"expand,omitempty"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Component string `yaml:"component,omitempty" json:"component,omitempty"`
IssueType string `yaml:"issue-type,omitempty" json:"issue-type,omitempty"`
Expand Down Expand Up @@ -68,6 +69,10 @@ func (o *SearchOptions) ProvideSearchRequest() *jiradata.SearchRequest {
}
req.StartAt = 0
req.MaxResults = o.MaxResults
if o.Expand != "" {
fields := strings.Split(o.Expand, ",")
req.Expand = append(req.Expand, fields...)
}

return req
}
Expand Down