In a Jira server (using Crowd) the users are managed with Active Directory.
When I perform this REST GET call via the browser
I get the expected answer, but if I perform the same call via Java code I get the following error:
The following email address retrieved more than one active user in this Jira instance: firstname.lastname@example.org
Any idea of where this error message is coming from?
Yes you're right, the email address is not unique in Jira server.
I have then created more that one user with the same email address but I get the whole list of users without any error when using
I don't know how to test if it can be somehow related to the Crowd/AD integration
Multiple users per email address can lead to some confusion. When you use the Jira feature to create or comment Jira issues from an email account, the code that polls the email inbox to read incoming messages and create or comment Jira issues, makes some assumptions based on email addresses. For example the message to Jira is normally addressed to "email@example.com" or something like that in the message "to" field, but, a "cc" field can be configured to become the assignee of an issue created from an email.
When that is done the assumption is that the first matching email address returned from a directory is the match for the assignee. When there are multiple users with one email address this can look kind of arbitrary and/or can end up being "not what was intended."
Anyway it is a subtle feature that can take some time to troubleshoot.
Not sure if you are, but if you are looking to retrieve only one user, you may be better off using "Get user" (https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-getUser), rather than the search method.
Edit: Looking at your response to another answer, looks like you are looking for multiple results. In that case, that error doesn't look like a Jira error to me, is it possible it's something in the code?
Hello, Atlassian Community! I thought it would be fun to do something different for my teams' last retrospective of 2019 so I'm planning to do a "year in review" with info-graphics. Wha...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events