new API - applying IssueCountResponse entity syntax to count issues in a specific project
Hi,
With the new API IssueCountResponse explanation, I couldn't figure out how to get the total number of issues contained in a specific project.
I tried the following in Postman:
- POST {{baseUrl}}/issuesGetter/count?fields=count&query=project:+%7Bname+of+my+project%7D
- GET {{baseUrl}}/issuesGetter/count?fields=count&query=project:+%7Bname+of+my+project%7D
What I received as a response, with the POST was:
"
{
"error": "Bad Request",
"error_description": "An Project-type entity with the specified ID (0-0) was not found",
"error_developer_message": "An Project-type entity with the specified ID (0-0) was not found"
}
"
A colleague of mine tried the same, and even received another error message mentioning "non null being null".
Important note: we are seeking to get the count, NOT overwrite anything.
Could you please help on that and document it?
Thanks in advance,
Please sign in to leave a comment.
I'm Lena from YouTrack. I will be happy to help you.
Please use the following instructions to get the issues count: https://www.jetbrains.com/help/youtrack/devportal/resource-api-issuesGetter-count.html#create-IssueCountResponse-method. We use POST in this example because we pass the filter query to the server.
Let me know if you need further assistance.
Hello Lena,
I tried to apply the issuesGetter syntax like this:
{{baseUrl}}/issuesGetter/count?fields=count&query=project:+%7BMy+Project+%7D
and also like:
{{baseUrl}}/issuesGetter/count?query=project:+%7BMy+Project+%7D
But I keep receiving this error:
Could you please provide the exact POST request syntax to use when we want to apply this issuesGetter request to count the number of issues of a project named My Project?
Hi again,
When trying another time with this:
youtrack/api/issuesGetter/count?fields=count&query=project:+%7BMy+Project%7D
Thanks in advance,
Hello,
This request doesn't support quesry, you should send the query in the request body:
https://www.jetbrains.com/help/youtrack/devportal/resource-api-issuesGetter-count.html#create-IssueCountResponse-method-sample-1
Sample request
Sample request body
Sample response body