コード例 #1
0
  private Issue createIssue(Object[] ticketObj) {
    Issue issue = new Issue();

    issue.setId(String.valueOf(ticketObj[0]));

    issue.setKey(String.valueOf(ticketObj[0]));

    issue.setLink(getUrl() + "/ticket/" + String.valueOf(ticketObj[0]));

    issue.setCreated(parseDate(String.valueOf(ticketObj[1])));

    issue.setUpdated(parseDate(String.valueOf(ticketObj[2])));

    Map attributes = (Map) ticketObj[3];

    issue.setType((String) attributes.get("type"));

    issue.setSummary((String) attributes.get("summary"));

    issue.setStatus((String) attributes.get("status"));

    issue.setResolution((String) attributes.get("resolution"));

    issue.setAssignee((String) attributes.get("owner"));

    issue.addFixVersion((String) attributes.get("milestone"));

    issue.setPriority((String) attributes.get("priority"));

    issue.setReporter((String) attributes.get("reporter"));

    issue.addComponent((String) attributes.get("component"));

    return issue;
  }
コード例 #2
0
  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;
  }