The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass query parameter "accountId" from gerUser() method call

Atifa Fahmeen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 3, 2020

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?

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events