Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Rest API Not returning more then 1000.

joko hobo
Contributor
August 17, 2018

I am using following REST API to get all the users on our JIRA server, but it never returns any additional record after 1000. There are more than 1000 users on server.

https://jira-server/rest/api/latest/user/search?startAt=0&maxResults=1000&username=.

It returns 1000 records. Then we execute following to get remaining records but we it always returns empty

https://jira-server/rest/api/latest/user/search?startAt=1000&maxResults=50&username=.

Any help on this issue? startAt & maxResults work fine till total record fetched is upto 1000 records, for example following REST call works but returns only 10 records (990 to 1000) even though there are 1100 users on server.

https://jira-server/rest/api/latest/user/search?startAt=990&maxResults=50&username=.

1 answer

1 vote
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2018

Hey there!

This behavior is from a Bug on Jira, you can find further details on the following bug report issue:

Currently, there are two known workarounds, make the REST call with a wildcard to stream users(check the workaround section in the ticket) or you can get the user information directly from the database in the "cwd_user" table.

Kind regards,
Maurício Karas

joko hobo
Contributor
August 21, 2018

How can i get data directly from database in the "cwd_user" table?

please reply with example.

thank you

Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 22, 2018

Just connect to Jira's database on your script or using a database visualizer or querying tool.

If you don't know which database Jira is using and how to access it, you can check the "dbconfig.xml" file in your Jira home directory. This file contains which database Jira is using, which URL, port, user, etc., this is everything you need to connect to it.

Then you can run a simple select query(note that this can change depending on the database type, SQL Server and Oracle can require you to inform a schema before the table name):

select * from cwd_user;

 The query will return all users from Jira, from that you can choose which fields you'll need.

Kind regards,
Maurício Karas

Suggest an answer

Log in or Sign up to answer