How to get a user by email in a JIRA plugin

When writing a plugin for JIRA, how do you get a user, or just their username, given their email address?

It seems that you're supposed to use the findUsersByEmail method in the UserSearchService interface

https://docs.atlassian.com/jira/7.0.2/com/atlassian/jira/bc/user/search/UserSearchService.html

But how do you get an instance of this class? Or a singleton of it?

1 answer

0 vote
Vasiliy Zverev Community Champion Mar 10, 2016

To get most of class instances ComponentAccessor

UserSearcherHelper userSearcherHelper = ComponentAccessor.getComponent(UserSearcherHelper.class);

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

37 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you