Skip to content

Commit

Permalink
allow "abort: true" to be set while editing to cancel the edit operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Bennett committed Sep 12, 2015
1 parent 99f62a9 commit ea67a77
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jira/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ func (c *Cli) editTemplate(template string, tmpFilePrefix string, templateData m
edited = fixed.(map[string]interface{})
}

// if you want to abort editing a jira issue then
// you can add the "abort: true" flag to the document
// and we will abort now
if val, ok := edited["abort"].(bool); ok && val {
log.Info("abort flag found in template, quiting")
return fmt.Errorf("abort flag found in template, quiting")
}

if _, ok := templateData["meta"]; ok {
mf := templateData["meta"].(map[string]interface{})["fields"]
if f, ok := edited["fields"].(map[string]interface{}); ok {
Expand Down

0 comments on commit ea67a77

Please sign in to comment.