diff options
Diffstat (limited to 'src/createchangelog/main.go')
-rw-r--r-- | src/createchangelog/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/createchangelog/main.go b/src/createchangelog/main.go index 1706b5e2..7fc82a58 100644 --- a/src/createchangelog/main.go +++ b/src/createchangelog/main.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/go-version" "github.com/eidolon/wordwrap" + "github.com/andygrunwald/go-jira" ) type commandWithCapturedOutput struct { @@ -245,11 +246,20 @@ func extractBugFix(commitMessage string) (entry changeLogEntry) { } if taskNumber != "" { + wrapper := wordwrap.Wrapper(70, false) entry.text = "[" + taskNumber + "] " + summary if description != "" { - wrapper := wordwrap.Wrapper(70, false) entry.text += "\n" + wordwrap.Indent(wrapper(description), " ", false) } + jiraClient, _ := jira.NewClient(nil, "https://bugreports.qt.io/") + issue, _, err := jiraClient.Issue.Get(taskNumber, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "%s: %s\n", taskNumber, err.Error()) + return + } + if (issue != nil) { + entry.text += "\n" + wordwrap.Indent(wrapper("The bug was: " + issue.Fields.Summary), " ", false) + } } else { entry.text = "" } |