2

Using the REST API is it possible to returns all issues created after a given date(for eg:2013-03-13)

I tried GET /issues.json?created_on>2013-03-13. But the result displays all the issues. Is it possible to get Issue after a given date.

Is it also possible to get issue after a given date with time for eg: GET /issues.json?created_on>2013-03-13 11:45:36 +0530

4

1 回答 1

2

Fast solution

GET /issues.json?set_filter=1&f[]=created_on&op[created_on]=%3E%3D&v[created_on][]=2013-04-23

for example

http://www.redmine.org/projects/redmine/issues.json?set_filter=1&f[]=created_on&op[created_on]=%3E%3D&v[created_on][]=2013-04-23

How to find the matching filter

Browse the issues list with your favorite browser and set some filters in the UI (there is a Add filter select box right above the issue listing). Then click apply and wait until the page loaded. Now inspect the current URL. In the URL replace [...]/issues?[...] with [...]/issues.json?[...], and you have your json output.

Unfortunately I can't find a filter for times. But it should be easy to develop a redmine plugin (or patch for the redmine core) to implement such a filter.

Further investigation

The Issues#index controller action actually builds a Query object from your parameters. You can read about creating that query in the queries_helper.rb#L184

于 2013-04-23T09:37:30.850 回答