jira-tools icon indicating copy to clipboard operation
jira-tools copied to clipboard

JiraUpdateTicket.gs

Open paul-lemon opened this issue 6 years ago • 5 comments

Name would be better as UpdateJiraTicketManager

Single Responsibility - Update a series of JIRA tickets using the same column / field defintions Use of a class will enable refactoring

  1. Reduce length and complexity of method updateJiraIssues (approx 70 lines)
  2. Remove need for convoluted error handling of field names identified in https://github.com/ljay79/jira-tools/pull/130 `if (responseData.errors != null) { Object.keys(responseData.errors).forEach(function (fieldid) { jiraErrorMessage = jiraErrorMessage + "{Field:" + fieldid + "}: " + responseData.errors[fieldid] + ", "; }); }

3. Function below should be private function getMatchingJiraFields(allJiraFields, headerRow) {`

paul-lemon avatar Feb 06 '19 21:02 paul-lemon

We wont need to include the string "jira" everywhere :) as the entire code base is all about jira.

Ticket vs Issue I notice myself, mixing up the same thing calling it sometimes Ticket and other time Issue. Lets try (going forward) to stick to Atlassian terminology: Issue

So my name suggestion including above statements would be: IssueUpdateManager

ljay79 avatar Feb 06 '19 22:02 ljay79

agreed - I think some naming conventions in a Contributing.MD to avoid future naming mishaps too.

paul-lemon avatar Feb 06 '19 22:02 paul-lemon

Sure, as soon i have more than 1 convention :)

ljay79 avatar Feb 06 '19 22:02 ljay79

packageRowForUpdate should be private also.

paul-lemon avatar Feb 06 '19 23:02 paul-lemon

This is underway with the re-factoring work I am doing. The file has been renamed but I aslo plan in moving a lot of the code into the Issues and IssueFields models and the updateIssues controller. I expect the file will be removed from the code base once that is completed.

paul-lemon avatar Feb 17 '19 11:02 paul-lemon