How to get all users using Java API in Jira 10

Hi, does anyone found a way how to get all the users created under Jira instance using Java API?
I want to use not deprecated methods but I don’t think it is possible.
Following method is deprecated since Jira 7.x: UserManager (Atlassian Jira - Server 10.5.0 API)

So we used following in Jira 8:

UserSearchParams userSearchParams = UserSearchParams.builder(userManager.getTotalUserCount())
                .allowEmptyQuery(true)
                .includeActive(true)
                .includeInactive(true)
                .build();

return userSearchService.findUsers("", userSearchParams)

but it is not possible on Jira 10, because the results are limited to 100 but there is no pagination implemented.

I think there are still the cases in which we need to get all the users. In my case, I have user properties stored on user and need to analyze it. Without possibility to get all the users I will need to create my own active objects table and services with all the users.

Thank you

I also tried /rest/api/2/user/search endpoint but it looks like I am affected by https://jira.atlassian.com/browse/JRASERVER-78520 and https://jira.atlassian.com/browse/JRASERVER-78660
Did anyone find a workaround which is not about direct access to the Jira DB?

1 Like