Find JIRA user based on user's email address

Artem Lemeshko February 6, 2020

I need to be able to find a customer by email from JIRA.

We are using /rest/servicedeskapi/customer POST request to create customer and in case we are getting a message that customer already exists, can we get information about the existing customer from Jira?

Any tips or recommendations would be appreciated.

1 answer

3 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2020

Hi Artem,

If I understand your situation here, you're wanting to be able to see if a particular email address already has an account in your Jira Cloud site.  This is not as easy as it used to be when searching by the REST API in Jira Cloud, I believe this is largely due to the GDPR compliance changes.

The answer depends on where you are wanting to look to find this info.  If you are a site-admin, then you should have access to be able to see a list of all the Jira Service desk customer portal only users by going to select the Jira icon (, or ) > People > Manage users > Jira Service Desk.  On this page there is an Export customers button that you can export a list of your users there that also includes their email addresses.

But I imagine you are looking for a means to do this via the REST API. In which case, I'd recommend reviewing our Deprecation notice and migration guide for major changes to Jira Cloud REST APIs to improve user privacy from last year.  Much changed since that time in regards to what data is returned from REST and how.  You could try to use the endpoint GET /rest/api/3/users/search.  Please note that in order to get back useful results, you either need to supply the username or use the query parameter here.  So the call might look like this:

/rest/api/3/user/search?query='user@example.com'

Alternatively could do this using the endpoint of GET /rest/api/3/groupuserpicker.  In this example, you could query for an email address to hit the endpoint of

/rest/api/3/groupuserpicker?query='user@example.com'

In my own testing this can help, but it is not a perfect solution.  Largely because search results are sometimes returning values that might match a username, but not the email domain, or vice versa.  There is still a need to closely compare the results that come back from these REST endpoints with the exact string of the email address queried for here.

Sorry if that isn't as clear as you would want to see this data, but I hope this helps.  Please let me know either way.

Andy

Yavuz Selim Parmaksiz March 20, 2024
/rest/api/3/user/search?query='user@example.com'

Works very well! I was searching for getting accountId from email address of Jira User on Cloud. The response includes accountId. 

Thank you @Andy Heinzer  

Suggest an answer

Log in or Sign up to answer