[#45] automatically add comment to issue even if transition does not support comment updates during transtion

This commit is contained in:
Cory Bennett
2017-09-06 21:28:57 -07:00
parent 9cc91f7108
commit c4be59cae3
+9
View File
@@ -133,6 +133,15 @@ func CmdTransition(o *oreo.Client, globals *jiracli.GlobalOptions, opts *Transit
Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"`
}
if _, ok := transMeta.Fields["comment"]; !ok && opts.Overrides["comment"] != "" {
comment := jiradata.Comment{
Body: opts.Overrides["comment"],
}
if _, err := jira.IssueAddComment(o, globals.Endpoint.Value, opts.Issue, &comment); err != nil {
return err
}
}
issueUpdate := jiradata.IssueUpdate{}
input := templateInput{
Issue: issueData,