private void collectInfo(TrackedIssue issue) { if (!StringUtils.isEmpty(issue.assignee())) { userLoginNames.add(issue.assignee()); } if (issue.getRuleKey() != null) { ruleKeys.add(issue.getRuleKey()); } }
@Override public void execute() { if (listener == null) { return; } for (TrackedIssue issue : issues.all()) { collectInfo(issue); } getUsers(); for (TrackedIssue issue : issues.all()) { IssueListener.Issue newIssue = new IssueListener.Issue(); newIssue.setAssigneeLogin(issue.assignee()); newIssue.setAssigneeName(getAssigneeName(issue.assignee())); newIssue.setComponentKey(issue.componentKey()); newIssue.setKey(issue.key()); newIssue.setMessage(issue.getMessage()); newIssue.setNew(issue.isNew()); newIssue.setResolution(issue.resolution()); newIssue.setRuleKey(issue.getRuleKey().toString()); newIssue.setRuleName(getRuleName(issue.getRuleKey())); newIssue.setSeverity(issue.severity()); newIssue.setStatus(issue.status()); newIssue.setStartLine(issue.startLine()); newIssue.setStartLineOffset(issue.startLineOffset()); newIssue.setEndLine(issue.endLine()); newIssue.setEndLineOffset(issue.endLineOffset()); listener.handle(newIssue); } }