We have more than 50 projects in jira and we want only first 10 projects in our app and later 10 more.how can we achieve this through jira rest api?
Hi @Ashish Bijlwan,
If you refer to documentation for the Jira rest api you used, you will see that it return list of all of project visible for the currently logged in user, i.e. all the projects the user has either ‘Browse projects’ or ‘Administer projects’ permission.
So the solution I have found is that either to use a user that has access to only the 10 project or use the recent property.
hello again @Ashish Bijlwan,
The documentation vaguely state that pagination is enforced for methods that could return a large collection of items without clearly defining how much large is. I think they assumed that list of projects couldn't be large and didn't enforce pagination on this api.
So instead use the recent query parameter, which if set returns Only projects recently accessed by the current user. If no user is logged in, recently accessed projects will be returned based on current HTTP session. Maximum count is limited to the specified number, but no more than 20.
Hope this Helps!
You may have a look at pagination section in https://developer.atlassian.com/server/jira/platform/rest-apis/
Clients can use the
total parameters to retrieve the desired number of results.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events