Unfortunately, from the description of this documentation it is not clear how to add a comment to the pool request itself?
https://docs.atlassian.com/bitbucket-server/javadoc/4.11.1/api/reference/com/atlassian/bitbucket/comment/AbstractAddCommentRequest.AbstractBuilder.html
In 5.0, CommentService is used for this purpose, but how to do it in 4.11 without CommentService ?
@ExportAsService@Named("PullRequestReviewerListener")public class PullRequestReviewerListener {@ComponentImportprivate final PullRequestService pullRequestService;@Injectpublic PullRequestReviewerListener(final PullRequestService pullRequestService) { this.pullRequestService = pullRequestService;}public void OnPullRequestOpen(PullRequestOpenedEvent event) { PullRequest pr = event.getPullRequest(); Repository repository = pr.getToRef().getRepository(); Comment newComment = pullRequestService.addComment(repository.getId(), pr.getId(), "Comment text");}}
It looks like you're new here. Sign in or register to get started.