Can you use multiple email addresses in Find users REST API

Hi Iragudo!! it is possible to add more than email address?? will appreciate if you can help me out, need to look for multiple email address so I can get the account id.

Welcome to the Atlassian Developer Community, @sivianimadrigal!

The Find users REST API accepts a query query parameter which only accepts one email address or display name at a time.

For this use case, I can think of two approaches:

  1. Iterate over the email address list that you have and call Find users, or
  2. Use Get all users REST API to get and match the email addresses in your app code

Depending on the number of email addresses you are searching for, as well as the total number of users the instance has, you can try either of the approaches.

Cheers,
Ian

1 Like

Get all users doesn’t appear to include emailAddress in the response so how would you propose someone matches the email using that method?

Hello @ChrisBellinger

The Get users endpoint does return email addresses of users, but only if they have allowed that in their privacy settings. This is stated in the endpoint’s documentation:

Privacy controls are applied to the response based on the users’ preferences. This could mean, for example, that the user’s email address is hidden. See the Profile visibility overview for more details.

1 Like

That’s all fine and good. But the email (or username) seem to be the only reliable way to find a user to acquire their account-id to then use in other operations. I’ve used the /rest/api/3/user/search/query=email method to get the user but that only works if they are active. It was proposed to use the Get all users operation and troll through the results if you need inactive users but that doesn’t help if the inactive user has their email hidden. And because they are inactive, that won’t change.

If you have a suggestion for another way to reliably detect the existence of a user no matter their status without having their account ID, I’d love to try it!

None of this has much to do with the OP’s original question, as you’re now veering off topic into a debate on endpoint functionality. Jira’s user searching endpoints do what they do for a reason… compliance with privacy laws.

If you have a suggestion for another way to reliably detect the existence of a user no matter their status without having their account ID, I’d love to try it!

Time to start thinking about the Cloud Admin APIs and looking up managed users at the organisation / directory level.

Have fun.

Thanks. I will check it out. I agree that compliance is important. The fact that you can’t return inactive users on the Find Users operation, however, has nothing to do with compliance. But you are right, there are other posts on this topic. Appreciate the help.