Problem with /issuesGetter/count Endpoint.
I have this request issues count:
{
"folder": {
"$type":"Project",
"id":"0-103"
},
"query":"from:me project:{CSDEV} 1006654684352 usuario123",
"unresolvedOnly":false
}
but the response in count field, most of the time it is -1, eventually it is the correct value.... this is a bug? exists solution?
Please sign in to leave a comment.
Hello, thank you for your question. The -1 response is totally normal when you have a lot of data. This response means that YouTrack hasn't finished counting the entries yet. If you repeat the request after some time, the response contains the actual number.
It's not possible to predict how long it takes to calculate the actual response as it depends heavily on the number of entries in each request.
I hope this helps make things clear.
For reference, see https://www.jetbrains.com/help/youtrack/devportal/resource-api-issuesGetter-count.html#create-IssueCountResponse-method-sample-2
Thank you, but the problem I have is that it does not return the correct value for a long time. I have tried it in a cycle of five repetitions with delays of two seconds and it never returns the correct value.
In your original message in this thread, you wrote that the request eventually does return the actual number of issues. Is this still the case, or did it stop working altogether?
You've shared a request example at the beginning of this thread; how many issues did this request return when it was successful?
If this problem turns out to be a performance one, I'd suggest we move this discussion to a private support ticket. This way, we'll be able to figure out the reason and fix it more efficiently. You can find the link to submit a ticket in the header of this page.