How do I count entries within a date range VIA the API please?


I am trying to get the totoal number of bugs opened within a date range as well as closed in the same data range. This will be repeated every 2 weeks. I have reviewed the API docs and I am happy with the count option however I have been unable to figure out the correct way to represent a date range:

For starters I wish to get all bugs pre 1st Feb 2012, to do this in the front end I woud use 'created: 2011-01 .. 2012-02-01'.

This provides following URL:

This seems reasonable so I have attempted it via the api:

However this has not worked.

I have tried different ordering and encodings bug to no aval.

Is this possible with YouTrack or am I simply using the wrong syntax?




Dear Anthony,

Count method of REST API returns either number of issues matching the request or -1 if count is not calculated yet. So to get real number of issues you have to call to the count method until it returns something different from -1. This is implemented this way for performance reason: calculation of query size can be time cosuming and YouTrack doesn't want to keep http connection while size is calculated.


Hi Max

I understand the -1 response and have catered for this in my script, I am referring to the query as I am submitting it. Syntactically is it a valid query which the API should respond to?


Or should it use Epoch timestamp?




Please sign in to leave a comment.