问题
I am trying to get specific issues from a plan.io project using the Redmine REST API. I want to list issues from a project that have the status of "in progress" or "to estimate". But I am not sure what kind of query string to write. I cant find any thing in API documentation on the redmine site.
Here is how to get all the issues from a project.
http://someurl.com/issues.json?key=185f14564g65f4g65df4g46570a0eb4267&project_id=2
But how do I get only the issues from a project that have status equal to "in progress" or "resolved" etc. I know how to get IDs for the statuses but not sure how write the query. This is what I tried but didnt work.
http://someurl.com/issues.json?key=185f14564g65f4g65df4g46570a0eb4267&project_id=2&issue_status_id=2
回答1:
The documentation says there's a status_id parameter for list only issues for a given status id. Example:
http://demo.redmine.org/issues.xml?project_id=16992&status_id=2
Tthe issue_statuses service can tell you what are the statuses codes
http://demo.redmine.org/issue_statuses.xml
You can set several search values for status with the following syntax:
http://demo.redmine.org/issues.xml?f[]=status_id&op[status_id]=%3D&v[status_id][]=2&v[status_id][]=3
I have to admit it was not mentioned in the documentation, but I found it by setting the filters in the web interface, and than modify the url to call the webservice with the same parameters.
来源:https://stackoverflow.com/questions/18358333/how-to-get-issues-from-a-project-that-have-status-in-progress-using-redmine-re