coreos / issue-sync

A tool for synchronizing issue tracking between GitHub and JIRA
Apache License 2.0
124 stars 34 forks source link

Move the get issue out of the client functions #20

Closed MorganEPatch closed 7 years ago

MorganEPatch commented 7 years ago

I had previously placed a GetIssue call inside of the JIRA client create/update issue functions, but in cases where these functions aren't called (for example, if it skips over the update call because the issue didn't change), the Get call is never made, and an incomplete Issue object (including a nil comments field) is passed to CompareIssues(), causing it to create new comments on every run.

This moves the GetIssue call to the end of the lib.CreateIssue() and lib.UpdateIssue() functions, before the call to CompareIssues(), thus ensuring it is always called.