Rest API: Can't get filter to work with /rest/issue/count

I'm trying to get the issue count for issues updated between certain dates. In YouTrack UI I can search on:

updated: 2011-07-01 .. 2011-07-31

Which generates this URL: http://localhost/issues?q=updated%3A+2011-07-01+..+2011-07-31

When I try to do the equivalent using the REST API, it doesn't seem to work. Calling this:

http://localhost/rest/issue/count?filter=updated: 2011-07-01 .. 2011-07-31

Returns this:

<int>-1</int>

I am making this call by putting the URL above into the browser.

5 comments
Comment actions Permalink

Dear Christian,

Call this method in a loop with a delay unless it returns something more or equal than 0. This method should return immediatly but calculation of a count of issues returned by a query is a heavy task. So when you call this method YouTrack checks if the count for the query is already calculated, if it is then YouTrack returns the calculated value, otherwise it returns -1 and adds count calculation task to a special queue.

Here is the sample of count method usage: http://hadihariri.com/2010/12/14/generating-graphs-for-youtrack-with-html-5-and-jquery/

0
Comment actions Permalink

Please, add to the documentation following notes:

GET /rest/issue/count?{filter}&{callback}

should be really

GET /rest/issue/count?filter={filter}&callback={callback}

because it's not obvious at all what parameters should be.
And please add also a note that -1 doesn't mean error, but that answer is not ready. I've spent about two hours to figure that out until I saw this thread.
Thank you.
0
Comment actions Permalink

Hello, Alexey!

Thank you, we'll ad note about "-1" response to the documentation.

What about url parameters, this is common format for all our documentation, so I think that we can may be add some common note about this format.

0
Comment actions Permalink
Hello, Can someone help me?
I am trying to run filters that in youtrack have "{}" brackets around them.
How do I account for this in the API?
For example Filter in Youtrack of project: {Small Projects}Sprint: {September 21, 2012}

Thanks!
Jason
0

Please sign in to leave a comment.