use of org.eclipse.egit.github.core.Label in project maven-plugins by apache.
the class GitHubDownloader method createIssue.
protected Issue createIssue(org.eclipse.egit.github.core.Issue githubIssue) {
Issue issue = new Issue();
issue.setKey(String.valueOf(githubIssue.getNumber()));
issue.setId(String.valueOf(githubIssue.getNumber()));
issue.setLink(this.githubIssueURL + githubIssue.getNumber());
issue.setCreated(githubIssue.getCreatedAt());
issue.setUpdated(githubIssue.getUpdatedAt());
if (githubIssue.getAssignee() != null) {
if (githubIssue.getAssignee().getName() != null) {
issue.setAssignee(githubIssue.getAssignee().getName());
} else {
issue.setAssignee(githubIssue.getAssignee().getLogin());
}
}
issue.setTitle(githubIssue.getTitle());
issue.setSummary(githubIssue.getTitle());
if (githubIssue.getMilestone() != null) {
issue.addFixVersion(githubIssue.getMilestone().getTitle());
}
issue.setReporter(githubIssue.getUser().getLogin());
if (githubIssue.getClosedAt() != null) {
issue.setStatus("closed");
} else {
issue.setStatus("open");
}
List<Label> labels = githubIssue.getLabels();
if (labels != null && !labels.isEmpty()) {
issue.setType(labels.get(0).getName());
}
return issue;
}