Project's issues API inconsitency

Hi,

I've got a weird behaviour when I try to get all the issues of a specific project from the API.

I'm using two different methods listed here: https://www.jetbrains.com/help/youtrack/devportal/api-entity-Issue.html#-qryiy6_3

My first query is /api/admin/projects/{projectId}/issues?fields=id and gives me 42 issues.

However, my second query is /api/issues?query=project:{shortName}&fields=id and this gives me 210 issues, which is the correct number.

I really want to use the first query because I reference my project by its id and not its short name.

What is happening?

0
1 comment
Official comment

Hi Nathanael,

I'm Sergey from the YouTrack Team. Thanks for reaching out!

The difference you're seeing is due to pagination. The /api/admin/projects/{projectId}/issues endpoint returns a maximum of 42 issues by default, which is why you're only seeing 42 results instead of all 210.

To retrieve all issues from your project, you'll need to implement pagination in your requests. Check out the Pagination Guide for details on how to page through results and retrieve the complete set of issues. This pagination limit exists to prevent performance issues when working with large datasets.

Let me know if you have any questions!

Please sign in to leave a comment.