-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What are all filter operations for issues #57
Comments
This information is from official Redmine REST API docs. You can see the available combinations at the link I provided, but I believe that this kind of query will only work with timestamp fields, so I'm 99% sure that this won't work for your exact case. Also I've just tried to find all issues from a project with more than one author via the usual Redmine GUI and I wasn't able to do that, because when you apply the author filter for one person, you can't add second author filter for another person, so it just isn't possible at all. You have to get all issues from a project and then filter them in cycle. Speaking about this filter operations - this is not a magic done by Python-Redmine, this filter operations are provided by the Redmine itself and Python-Redmine just sends this operations to Redmine and receives the response. |
I guess author_id is a bad example. Say if you have a Custom Field that is a MultipleList type. From Redmine's interface you can do an |
Yeah, I understand the problem. I also wasn't able to find any docs that lists all the available operators, so I looked at Redmine's source code and I believe that it should be what we're looking for, though I didn't test it and I'm not sure if it will work. Also I don't have an answer right now to your question about multiple custom fields. I believe the only thing we can do is to look through the entire Redmine's source code and to find all this operators, then test them and see if they work or not. This is a big amount of work, so I can't do that right now, but I will do a little bit later. This issue will remain open until we won't find answers to all this questions. |
I figured I'd chime in quickly and mention that I had problems filtering issues against a datetime. Date worked fine, but datetime would not. I found that the ability to filter against a datetime was added in Redmine 2.5, and I was using 2.4. http://www.redmine.org/issues/8842 Once I upgraded, I could use a filter like: Cheers! |
Redmine 2.6 references the "fixed_version" in two places which might be worth investigating == versions_controller.rb 47 @issues_by_version = {}
48 if @selected_tracker_ids.any? && @versions.any?
49 issues = Issue.visible.
50 includes(:project, :tracker).
51 preload(:status, :priority, :fixed_version).
52 where(:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)).
53 order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
54 @issues_by_version = issues.group_by(&:fixed_version) == issue_query.rb 197 if versions.any?
198 add_available_filter "fixed_version_id",
199 :type => :list_optional,
200 :values => versions.sort.collect{|s| ["#{s.project.name} - #{s.name}", s.id.to_s] }
201 end
...
388 # Returns the versions
389 # Valid options are :conditions
390 def versions(options={})
391 Version.visible.
392 where(project_statement).
393 where(options[:conditions]).
394 includes(:project).
395 all |
I can confirm that the API supports filtering the issues by the @see https://github.com/ctsit/redman/blob/master/fabfile.py#L350 |
I did some testing with the fixed_version parameter for selecting all issues related to a particular version within a project Based on a StackOverflow answer[1]. It seems to work properly only when you also add the project_id in the url, something the python-redmine issue.filter() function currently does not do. I also could not find this case documentation in the redmine REST API documentation. However, it does work luckily. The author of the answer uses the following:
[1]http://stackoverflow.com/questions/19906773/using-redmine-rest-api-to-access-issues-with-criteria Maybe nice to add this in a next version of python-redmine? |
Ok, just found the documentation @necrolyte2 was looking for: http://www.freelancingdigest.com/articles/redmine-query-reference/ @maxtepkeev: would it be possible to somehow integrate the above in python-redmine? |
Regarding the #57 (comment), thanks for this information, the problem is that if we use the Regarding the #57 (comment) - cool, thanks for this, I definitely will add this into new documentation which will be available together with python-redmine v2.0 that should be ready approximately by the end of October. |
Not sure whether this the most elegant solution, but might a filter_by_project() method be an option ? Personally, I implemented by creating a custom_resource class, and changed the url there... |
I found this in the documentation for filtering issues
I see that you have ><fromdate|todate
Is there a listing somewhere of all of the available operators
For my specific case I want to do an
in
oror
operation such asThe text was updated successfully, but these errors were encountered: