confluenceconfluence-rest-api

Username from user mail


I am using confluence server 7.13.7. Is there a way through which I can get a user’s username through the user’s mail?

I want to get a user's name on the basis of their email. I will have the list of user emails in a confluence instance and I want to fetch their username so that I can use it for making other API calls to get some more details about that particular user. I will also have the required administrative privileges to make such API calls.


Solution

  • com.atlassian.user.search.SearchResult getUsersByEmail(String email)
    

    This is deprecated but still works and knowing atlassian , will work for years to come... :)

    from official website:

    https://docs.atlassian.com/ConfluenceServer/javadoc/7.10.1/bucket/user/UserAccessor.html#getUsersByEmail-java.lang.String-