mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-06 21:20:48 +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{}{
|
json, err := jsonEncode(map[string]interface{}{
|
||||||
"body": comment,
|
"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}}
|
depends: {{ range .fields.issuelinks }}{{if .inwardIssue}}{{ .inwardIssue.key }}[{{.inwardIssue.fields.status.name}}]{{end}}{{end}}
|
||||||
priority: {{ .fields.priority.name }}
|
priority: {{ .fields.priority.name }}
|
||||||
description: |
|
description: |
|
||||||
{{ if .fields.description }}{{.fields.description | indent 2 }}{{end}}
|
{{ or .fields.description "" | indent 2 }}
|
||||||
|
|
||||||
comments:
|
comments:
|
||||||
{{ range .fields.comment.comments }} - | # {{.author.name}} at {{.created}}
|
{{ range .fields.comment.comments }} - | # {{.author.name}} at {{.created}}
|
||||||
{{ .body | indent 4}}
|
{{ or .body "" | indent 4}}
|
||||||
{{end}}
|
{{end}}
|
||||||
`
|
`
|
||||||
const default_edit_template = `update:
|
const default_edit_template = `update:
|
||||||
@@ -93,7 +93,7 @@ const default_create_template = `fields:
|
|||||||
`
|
`
|
||||||
|
|
||||||
const default_comment_template = `body: |
|
const default_comment_template = `body: |
|
||||||
{{ or .overrides.comment | indent 2 }}
|
{{ or .overrides.comment "" | indent 2 }}
|
||||||
`
|
`
|
||||||
|
|
||||||
const default_transition_template = `update:
|
const default_transition_template = `update:
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ Command Options:
|
|||||||
setEditing(false)
|
setEditing(false)
|
||||||
err = c.CmdTransition(args["ISSUE"].(string), "stop")
|
err = c.CmdTransition(args["ISSUE"].(string), "stop")
|
||||||
} else if validCommand("comment") {
|
} else if validCommand("comment") {
|
||||||
|
setEditing(true)
|
||||||
err = c.CmdComment(args["ISSUE"].(string))
|
err = c.CmdComment(args["ISSUE"].(string))
|
||||||
} else if validCommand("take") {
|
} else if validCommand("take") {
|
||||||
err = c.CmdAssign(args["ISSUE"].(string), user)
|
err = c.CmdAssign(args["ISSUE"].(string), user)
|
||||||
|
|||||||
Reference in New Issue
Block a user