I'm using the Jira Cloud OpenAPI v2 in Java through this guide here: https://blog.developer.atlassian.com/update-to-jira-clouds-swagger-openapi-docs/
I'm trying to return a user by inputting his mail adress, but it doesn't work:
UsersApi usersApi = new UsersApi(apiClient);
User user = usersApi.getUser("email@example.com", null, null, null);
It says something about not finding anyone with that ID, I guessed that he needed the Atlassian user ID. I also tried this:
UserSearchApi userSearchApi = new UserSearchApi(apiClient);
PageBeanUser pageBeanUser = userSearchApi.findUsersByQuery("firstname.lastname@example.org", 0l, 50);
But that doesn't work either.
How can I return an user when I have his e-Mail?
Hi @Patrick Fabian ,
Due to GDPR changes, you'll need to use a query parameter to search email addresses. An example is provided at the REST API endpoint Get User . I've copied the Java code example and modified it (on the documentation, it uses an Account ID string) to show how email might be used as the search parameter:
// This code sample uses the 'Unirest' library:
HttpResponse<JsonNode> response = Unirest.get("https://your-domain.atlassian.com/rest/api/2/user")
Do note that depending on a user's privacy settings on their Atlassian account, you might not be able to access the email address. Hope that helps!
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
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