/** * Collects all issues on the repo and finds the first duplicate that has the same title. For this to work, the title * contains the hash of the stack trace. * * @param uniqueTitle Title of the newly created issue. Since for auto-reported issues the title is always the same, * it includes the hash of the stack trace. The title is used so that I don't have to match * something in the whole body of the issue. * @param service Issue-service of the GitHub lib that lets you access all issues * @param repo The repository that should be used * @return The duplicate if one is found or null * @throws IOException Problems when connecting to GitHub */ @Nullable private static Issue findFirstDuplicate(String uniqueTitle, final IssueService service, RepositoryId repo) throws IOException { Map<String, String> searchParameters = new HashMap<>(2); searchParameters.put(IssueService.FILTER_STATE, IssueService.STATE_OPEN); final PageIterator<Issue> pages = service.pageIssues(repo, searchParameters); for (Collection<Issue> page : pages) { for (Issue issue : page) { if (issue.getTitle().equals(uniqueTitle)) { return issue; } } } return null; }
if (issue != null) { params.put(FIELD_BODY, issue.getBody()); params.put(FIELD_TITLE, issue.getTitle()); User assignee = issue.getAssignee(); if (assignee != null)
Issue duplicate = findFirstDuplicate(newGibHubIssue.getTitle(), issueService, repoID); boolean isNewIssue = true; if (duplicate != null) {
id, issue.getHtmlUrl(), issue.getTitle(), issue.getBodyText(), issue.getBodyHtml(),
setProperty(issuenode, PropertyName.TITLE, issue.getTitle()); setProperty(issuenode, PropertyName.UPDATED_AT, issue.getUpdatedAt()); if (issue.getUser() != null) {