private void sendComment(Comment comment, RemoteIssueLink link, Pair<String, String> remoteUser, JSONObject commentJSON) {
try {
String header = "/rest/api/2/issue/" + link.getTitle() + "/comment";
restService.sendAsyncApacheRequest(RemoteLinkUtils.getHostFromApplicationLink(link), header, null,
remoteUser.first(), remoteUser.second(),
Request.MethodType.POST, commentJSON.toString(), commentDelay, param -> {
if (param != null) {
if (param.code == 201) {
logger.debug("Response code = 201, all is ok");
sendFilesFromComment(comment);
} else {
logger.error("Response: " + param.toString());
}
}
});
} catch (UnsupportedEncodingException | TypeNotInstalledException e) {
e.printStackTrace();
}
}