How to locate a JIRA account using email via REST API?

Hey everyone,

I’m working on a project where I need to check if a JIRA account exists for a specific email address. I’m using the JIRA REST API to connect from an external app.

Right now, I can find users by their username, but I’m stuck when it comes to searching by email. I’ve looked at the official docs, but I’m not sure if I’m missing something.

Has anyone done this before? Any tips or code snippets would be super helpful. I’m trying to avoid having to manually search through all user accounts.

Thanks in advance for any help!

hey there! i’ve dealt with this before. try using the /rest/api/2/user/search endpoint with the email as the query parameter. it’s not perfect, but it works most of the time. just remember to URL encode the email and check your permissions. good luck with your project!

I’ve encountered this challenge in my work with JIRA integrations. While there isn’t a specific endpoint designed for email searches, the /rest/api/2/user/search endpoint can be used with a query parameter to approximate this functionality. You can construct a GET request in which the query parameter is set to the desired email address and ensure that the email is properly URL encoded. After retrieving the JSON response, you might need to implement additional filtering on the client side to isolate an exact match. Be sure you have the necessary permissions for user searches in your JIRA instance. This approach has proven reliable across various configurations and versions.

I’ve actually tackled this issue before in one of my projects. The JIRA REST API doesn’t have a direct endpoint for searching users by email, but there’s a workaround I found effective.

You can use the /rest/api/2/user/search endpoint with the ‘query’ parameter. This endpoint allows for more flexible searching, including by email. Here’s a basic example of how you might structure the request:

GET /rest/api/2/user/[email protected]

This will return a list of users that match the query. If the email is unique in your JIRA instance, you should get a single result.

One caveat: this method might return multiple results if the email partially matches other fields. In that case, you’d need to filter the results on the client side to find the exact email match.

Remember to URL encode the email address in your actual request. Also, ensure you have the necessary permissions to search for users in your JIRA instance.