jira-tools
jira-tools copied to clipboard
JiraUpdateTicket.gs
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
- Reduce length and complexity of method updateJiraIssues (approx 70 lines)
- 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) {`
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
agreed - I think some naming conventions in a Contributing.MD to avoid future naming mishaps too.
Sure, as soon i have more than 1 convention :)
packageRowForUpdate should be private also.
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.