public void commentIssue( String repositoryName, User user, Collection<Commit> commits, String issue) { if (jiraService.isExistingIssue(issue)) { commits.forEach( commit -> { if (!jiraService.isIssueAlreadyCommented(issue, commit.getId())) { try { log.info("Comment issue <{}> for commit <{}>", issue, commit); if (!jiraService.performTransition( commit.getMessage(), issue, buildCommentForTransition(user, repositoryName, commit))) { jiraService.commentIssue( issue, new Comment(buildComment(user, repositoryName, commit))); } } catch (IOException e) { log.error("Unable to comment issue <{}>", issue, e); } } else { log.warn( "Issue <{}> has already been commented for commit <{}>", issue, commit.getId()); } }); } else { log.warn("Issue <{}> has been mentioned, but does not exists", issue); } }