mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-19 12:43:30 +02:00
[#98] add --status option for JQL filter on status with list command
This commit is contained in:
@@ -52,6 +52,7 @@ func CmdListUsage(cmd *kingpin.CmdClause, opts *ListOptions) error {
|
||||
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("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)
|
||||
cmd.Flag("watcher", "Watcher to search for").Short('w').StringVar(&opts.Watcher)
|
||||
return nil
|
||||
|
||||
@@ -22,6 +22,7 @@ type SearchOptions struct {
|
||||
IssueType string
|
||||
Watcher string
|
||||
Reporter string
|
||||
Status string
|
||||
Sort string
|
||||
MaxResults int
|
||||
}
|
||||
@@ -49,6 +50,9 @@ func (o *SearchOptions) ProvideSearchRequest() *jiradata.SearchRequest {
|
||||
if o.Reporter != "" {
|
||||
qbuff.WriteString(fmt.Sprintf(" AND reporter = '%s'", o.Reporter))
|
||||
}
|
||||
if o.Status != "" {
|
||||
qbuff.WriteString(fmt.Sprintf(" AND status = '%s'", o.Status))
|
||||
}
|
||||
if o.Sort != "" {
|
||||
qbuff.WriteString(fmt.Sprintf(" ORDER BY %s", o.Sort))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user