I have been trying to retrieve user by providing username but it throws an error com.atlassian.jira.rest.client.api.RestClientException: [ErrorCollection{status=404, errors={}, errorMessages=[The 'accountId' query parameter needs to be provided]}]
Now that I have found accountId of a user, how shall I pass it in the method call. getUser( ) method takes either userUri or username as parameter.
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
client = factory.createWithBasicHttpAuthentication(uri, task.getUsername(), task.getPassword());
User assignee = null;
assignee = client.getUserClient().getUser("5ea146404e1a4b0c13884f0a").claim();
I have provided accountId "5ea146404e1a4b0c13884f0a" in the call but it throws the same exception
com.atlassian.jira.rest.client.api.RestClientException: [ErrorCollection{status=404, errors={}, errorMessages=[The 'accountId' query parameter needs to be provided]}]
How to retrieve the user object in this case when I have accountId?
I have another question : If I do not have accountId, is there any method to retrieve the accountIds using email id or username?