httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(bitBucketUsername, bitBucketPassword));
final HttpPost httpPost = new HttpPost(endpoint);
final List<NameValuePair> params = new ArrayList<NameValuePair>();
final User user = userRepository.findOne(actor);
if(user == null) {
LOG.error("Cannot post an issue. User not found for ID: " + user);
return;
}
final String actorName = user.getFullName() + " (<" + user.getEmail() + ">)";
final String contentsWithUser = "Reported by: " + actorName + "\n\n";
params.add(new BasicNameValuePair(TITLE_PARAM, issueTitle));
params.add(new BasicNameValuePair(CONTENT_PARAM, contentsWithUser + issueContents));
params.add(new BasicNameValuePair(COMPONENT_PARAM, componentName));