mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-21 21:53:28 +02:00
minor tweak to prevent exceptions in some templates
set default for "commit" command to use editor
This commit is contained in:
@@ -496,7 +496,7 @@ func (c *Cli) CmdComment(issue string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if comment, ok := c.opts["comment"]; ok {
|
||||
if comment, ok := c.opts["comment"]; ok && comment != "" {
|
||||
json, err := jsonEncode(map[string]interface{}{
|
||||
"body": comment,
|
||||
})
|
||||
|
||||
@@ -35,11 +35,11 @@ blockers: {{ range .fields.issuelinks }}{{if .outwardIssue}}{{ .outwardIssue.key
|
||||
depends: {{ range .fields.issuelinks }}{{if .inwardIssue}}{{ .inwardIssue.key }}[{{.inwardIssue.fields.status.name}}]{{end}}{{end}}
|
||||
priority: {{ .fields.priority.name }}
|
||||
description: |
|
||||
{{ if .fields.description }}{{.fields.description | indent 2 }}{{end}}
|
||||
{{ or .fields.description "" | indent 2 }}
|
||||
|
||||
comments:
|
||||
{{ range .fields.comment.comments }} - | # {{.author.name}} at {{.created}}
|
||||
{{ .body | indent 4}}
|
||||
{{ or .body "" | indent 4}}
|
||||
{{end}}
|
||||
`
|
||||
const default_edit_template = `update:
|
||||
@@ -93,7 +93,7 @@ const default_create_template = `fields:
|
||||
`
|
||||
|
||||
const default_comment_template = `body: |
|
||||
{{ or .overrides.comment | indent 2 }}
|
||||
{{ or .overrides.comment "" | indent 2 }}
|
||||
`
|
||||
|
||||
const default_transition_template = `update:
|
||||
|
||||
@@ -251,6 +251,7 @@ Command Options:
|
||||
setEditing(false)
|
||||
err = c.CmdTransition(args["ISSUE"].(string), "stop")
|
||||
} else if validCommand("comment") {
|
||||
setEditing(true)
|
||||
err = c.CmdComment(args["ISSUE"].(string))
|
||||
} else if validCommand("take") {
|
||||
err = c.CmdAssign(args["ISSUE"].(string), user)
|
||||
|
||||
Reference in New Issue
Block a user