mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-06 04:58:30 +02:00
add --queryfields option to restrict data returned from jira search api. This is for performance
as the jira issue data can be quite large and we use almost none of it in the "list" template
This commit is contained in:
@@ -85,10 +85,18 @@ func (c *Cli) CmdList() error {
|
||||
query = qbuff.String()
|
||||
}
|
||||
|
||||
json, err := jsonEncode(map[string]string{
|
||||
fields := make([]string,0)
|
||||
if qf, ok := c.opts["queryfields"]; ok {
|
||||
fields = strings.Split(qf,",")
|
||||
} else {
|
||||
fields = append(fields, "summary")
|
||||
}
|
||||
|
||||
json, err := jsonEncode(map[string]interface{}{
|
||||
"jql": query,
|
||||
"startAt": "0",
|
||||
"maxResults": "500",
|
||||
"fields": fields,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -60,6 +60,7 @@ Command Options:
|
||||
-b --browse Open your browser to the Jira issue
|
||||
-c --component=COMPONENT Component to Search for
|
||||
-d --directory=DIR Directory to export templates to (default: %s)
|
||||
-f --queryfields Fields that are used in "list" template: (default: summary)
|
||||
-i --issuetype=ISSUETYPE Jira Issue Type (default: Bug)
|
||||
-m --comment=COMMENT Comment message for transition
|
||||
-o --override=KEY:VAL Set custom key/value pairs
|
||||
@@ -128,6 +129,9 @@ Command Options:
|
||||
if _, ok := opts["user"]; !ok {
|
||||
opts["user"] = user
|
||||
}
|
||||
if _, ok := opts["queryfields"]; !ok {
|
||||
opts["queryfields"] = "summary"
|
||||
}
|
||||
if _, ok := opts["directory"]; !ok {
|
||||
opts["directory"] = fmt.Sprintf("%s/.jira.d/templates", home)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user