I want to get list of Jira Users, preferably in one operation, by Jira Java API. I have list of corresponding User Keys. Most important restriction is that API must work both in Jira 6 and Jira 7.
Hello,
Try something like this
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.security.login.LoginManagerLoginManager loginManager = ComponentAccessor.getComponent(LoginManager.class);Set<ApplicationUser> appUsers = ComponentAccessor.getUserManager().getAllUsers();
Set<ApplicationUser>
Thank you for your answer, however I would like to get only users that keys I have, in order to avoid situation of loading all Jira Users to obtain only fraction of them, e.g. 2000 of 20000.
Filter the appUsers list as you wish. I do not think your Jira crashes if you get the full list first.
I will follow your advice. Last question: is there a way to get only active Jira Users?
It looks like you're new here. Sign in or register to get started.