YouTrack Standalone 2020.2 Help

Pagination

This page describes pagination option in YouTrack's REST API.

All resources that return collection of entities limit the number of returned entities, by default. If you do not explicitly specify the number of entities to return with the $top query parameter, the server returns maximum 42 first entities. To get the whole collection, you need to use pagination.

The vast majority of resources use pagination with $top and $skip query parameters. We call it general pagination here.

However, resources that work with issue-related activities use a specific method of pagination - cursors.

General Pagination

When you try to get a big collection of elements, YouTrack returns by default only first 42 elements. It's done to eliminate the server overload. To get the complete list of elements, use the $skip and $top request parameters:

  • $skip=N lets you skip N found elements and returns elements starting from N+1.

  • $top=M instructs the server to return a set of top M elements found.

Combining these two parameters, you can iterate through the whole collection of elements that you need. For example, you can iterate through a list of available issues in, let's say, packs of 50 elements:

https://example.myjetbrains.com/youtrack/api/issues?fields=id,idReadable,summary,description&$skip=0&$top=50 https://example.myjetbrains.com/youtrack/api/issues?fields=id,idReadable,summary,description&$skip=50&$top=50 https://example.myjetbrains.com/youtrack/api/issues?fields=id,idReadable,summary,description&$skip=100&$top=50

Or, you can iterate a big collection of versions in a bundle in packs of, let's say, 20 elements:

https://example.myjetbrains.com/youtrack/api/admin/customFieldSettings/bundles/version/42-1/values?$skip=0&$top=20&fields=archived,description,id,name,ordinal,releaseDate,released https://example.myjetbrains.com/youtrack/api/admin/customFieldSettings/bundles/version/42-1/values?$skip=20&$top=20&fields=archived,description,id,name,ordinal,releaseDate,released https://example.myjetbrains.com/youtrack/api/admin/customFieldSettings/bundles/version/42-1/values?$skip=40&$top=20&fields=archived,description,id,name,ordinal,releaseDate,released
Last modified: 1 July 2020