// the Atlassian Plugin SDK. If this is not the case in your JIRA instance, you will need to change these values.
final String jiraUser = "admin";
final String jiraPassword = "admin";
// Setup the JRJC
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
URI jiraServerUri;
try
{
jiraServerUri = new URI(jiraBaseURL);
}
catch (URISyntaxException e)
{
throw new ServletException("Could not understand the JIRA Base URL: " + e.getMessage(), e);
}
JiraRestClient client = factory.createWithBasicHttpAuthentication(jiraServerUri, jiraUser, jiraPassword);
String userToRetrieve = userManager.getRemoteUsername();
if (StringUtils.isBlank(userToRetrieve))
userToRetrieve = jiraUser;
Promise<User> promise = client.getUserClient().getUser(userToRetrieve);