Java Code Examples for org.eclipse.egit.github.core.Issue#getNumber()

The following examples show how to use org.eclipse.egit.github.core.Issue#getNumber() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GitHubExporter.java    From rtc2jira with GNU General Public License v2.0 5 votes vote down vote up
private Issue createGitHubIssue(Issue issue) throws IOException {
  boolean isAlreadyCreated = issue.getNumber() != 0;
  Issue createdIssue = null;
  if (!isAlreadyCreated) {
    createdIssue = issueService.createIssue(repository, issue);
  } else {
    issueService.editIssue(repository, issue);
  }
  return createdIssue;
}
 
Example 2
Source File: TurboIssue.java    From HubTurbo with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TurboIssue(String repoId, Issue issue) {
    this.id = issue.getNumber();
    this.title = issue.getTitle() == null
            ? ""
            : issue.getTitle();
    this.creator = issue.getUser().getLogin();
    this.createdAt = Utility.dateToLocalDateTime(issue.getCreatedAt());
    this.isPullRequest = isPullRequest(issue);

    this.description = issue.getBody() == null
            ? ""
            : issue.getBody();
    this.updatedAt = issue.getUpdatedAt() != null ?
            Utility.dateToLocalDateTime(issue.getUpdatedAt()) : this.createdAt;
    this.commentCount = issue.getComments();
    this.isOpen = issue.getState().equals(STATE_OPEN);
    this.assignee = issue.getAssignee() == null
            ? Optional.empty()
            : Optional.of(issue.getAssignee().getLogin());
    this.labels = issue.getLabels().stream()
            .map(Label::getName)
            .collect(Collectors.toList());
    this.milestone = issue.getMilestone() == null
            ? Optional.empty()
            : Optional.of(issue.getMilestone().getNumber());

    this.metadata = IssueMetadata.empty();
    this.repoId = repoId;
    this.markedReadAt = Optional.empty();
}