プロジェクト

全般

プロフィール

Vote #66696

未完了

List of tasks filtered as OR and not AND

Admin Redmine さんが3ヶ月前に追加. 3ヶ月前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues filter_56
対象バージョン:
-
開始日:
2010/02/26
期日:
進捗率:

0%

予定工数:
category_id:
56
version_id:
0
issue_org_id:
4939
author_id:
10071
assigned_to_id:
0
comments:
86
status_id:
1
tracker_id:
2
plus1:
38
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Hello

Up to now in the list of task you can filter upon some values but the list of filters are
List of tasks that has
filter1=value1 AND filter2=value2 AND filter3=value3

I think it could be interesting to have the possibility of
List of tasks that has
filter1=value1 OR filter2=value2 OR filter3=value3

Do you think it is possible? thank you


journals

+1. This would be useful for some filters I have tried to make as well.
--------------------------------------------------------------------------------
+1 I would _love_ it if Redmine had this functionality. Perhaps the easiest/most powerful way to implement this would be to make a way for users to create filters out of combinations of other filters. In other words, if I could define filters A, B, and C, and then say something like "Give me all the issues that are in A OR B, but not in C", I could get any issue list I could ever want. And that would be awesome.
--------------------------------------------------------------------------------
Jeremy Walker wrote:
> +1 I would _love_ it if Redmine had this functionality. Perhaps the easiest/most powerful way to implement this would be to make a way for users to create filter sets out of combinations of other filter sets. In other words, if I could define filter sets A, B, and C, and then say something like "Give me all the issues that are in A OR B, but not in C", I could get any issue list I could ever want. And that would be awesome.

--------------------------------------------------------------------------------
Any progress on this subject guys? ;o)
--------------------------------------------------------------------------------
+1
Thats nearly what I ment with #7641, but I'd like to combine AND and OR freely.

e.g. A AND B OR C AND D

should list all issues which fullfill both, A and B

plus the issue which fillfill both, C and D

Basically it should be read like disjunctive normal form

--------------------------------------------------------------------------------
also this could be interesting when one wants to list all issues
assigned to me, and also all which aren't assigned yet.

for this feature a filtercriteria must be usable more than one time

or other solution: the list of possible assignees contains a special element "Not assigned" at the top of the list, so one can select (by multiple selection) me and "Not assigned"
--------------------------------------------------------------------------------
It looks like it is implemented in "Trac": http://trac.edgewall.org/query, see the "OR" at the bottom right of the filters box
--------------------------------------------------------------------------------
Gurvan Le Dromaguet wrote:
> It looks like it is implemented in "Trac": http://trac.edgewall.org/query, see the "OR" at the bottom right of the filters box

I like it
--------------------------------------------------------------------------------
Yes this would be a good improvement. It won't be easy but a really cool addition to the current filter-system.
--------------------------------------------------------------------------------
+1

any workaround here? we need a filter like "is autor or observer"
--------------------------------------------------------------------------------
+1

Need Assignee or Watcher.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Here is my quick and dirty solution. I am not a RoR developer and this is my very first attempt so that I can use Redmine for my job.
I hope that someone can make this into a full plugin. If you have any idea or find problem, please let me know. I will see if I can do anything. Thanks
--------------------------------------------------------------------------------
Thanks for your patch! i look forward to implement that in our redmine!!

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 (thanks for your excellent work)
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Matthias Neubert wrote:
> +1
> Thats nearly what I ment with #7641, but I'd like to combine AND and OR freely.
>
> e.g. A AND B OR C AND D
>
> should list all issues which fullfill both, A and B
>
> plus the issue which fillfill both, C and D
>
> Basically it should be read like disjunctive normal form

+1

so important feature and no progress for 5 years :(
--------------------------------------------------------------------------------
>so important feature and no progress for 5 years :(
We only have 2 programmers working in their spare time, plus contributions from a few other volunteers.

If you send patches that apply cleanly against current trunk (together with tests) we'd happily test and apply those.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
I have made this patch into a plugins here (with some improvement). It works with redmine 2.6.x and 3.1.1 or less. Please use the plugin instead of this patch

http://www.redmine.org/plugins/zquery

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
What is the difference between zquery and _query?

Did someone tested one with Redmine 2.4?
--------------------------------------------------------------------------------
Fred B wrote:
> What is the difference between zquery and _query?
>
> Did someone tested one with Redmine 2.4?

Dear Fred
1. They are the same but I renamed zquery to _query so it is loaded first. _query is now the "official" version :-) (I have replace zquery attachment with _query but the name is still in the link)
2. I think it should work with 2.3 upward since I developed it based on 2.3 version
Quan
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
So is there any chance that the _query plugin getting updated to function with Redmine 3.4? I tried to figure out how to update it, but it's not clear to me what needs to be changed to make it compatible.

It gives me the following error in 3.4 as is:
<pre>Showing /opt/redmine/app/views/queries/_filters.html.erb where line #4 raised:

undefined method `remote' for #<Hash:0x007fe319fa1de8>
Extracted source (around line #464):
462
463
464
465
466
467

available_filters.each do |field, filter|
options = {:type => filter[:type], :name => filter[:name]}
options[:remote] = true if filter.remote

if has_filter?(field) || !filter.remote
options[:values] = filter.values

Trace of template inclusion: app/views/queries/_query_form.html.erb, app/views/issues/index.html.erb

Rails.root: /Users/noysh/projects/farview/farview-devlink-3.4-stable

Application Trace | Framework Trace | Full Trace
app/models/query.rb:464:in `block in available_filters_as_json'
app/models/query.rb:462:in `each'
app/models/query.rb:462:in `available_filters_as_json'
app/views/queries/_filters.html.erb:4:in `block in _app_views_queries__filters_html_erb__941875204378063440_70306769152520'
app/views/queries/_filters.html.erb:1:in `_app_views_queries__filters_html_erb__941875204378063440_70306769152520'
app/views/queries/_query_form.html.erb:10:in `_app_views_queries__query_form_html_erb___1924681068357817272_70306752298920'
app/views/issues/index.html.erb:11:in `block in _app_views_issues_index_html_erb___4300101081652184242_70306752230600'
app/views/issues/index.html.erb:10:in `_app_views_issues_index_html_erb___4300101081652184242_70306752230600'
app/controllers/issues_controller.rb:51:in `block (2 levels) in index'
app/controllers/issues_controller.rb:46:in `index'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Request

Parameters:

{"project_id"=>"project_name"}
Toggle session dump
Toggle env dump
Response

Headers:

None</pre>
--------------------------------------------------------------------------------
Shaun Gilroy wrote:
> So is there any chance that the _query plugin getting updated to function with Redmine 3.4? I tried to figure out how to update it, but it's not clear to me what needs to be changed to make it compatible.
>
> It gives me the following error in 3.4 as is:
> [...]

Dear Shaun
I am sorry. This version of plugin is too old. I create a separate entry for this plugin and put the update here and it works with redmine 3.4
https://www.redmine.org/plugins/boolean_query
Unfortunately I cannot find way to delete this old attachment
Quan
--------------------------------------------------------------------------------
For redmine 3.4, please use the version at
https://www.redmine.org/plugins/boolean_query
Or use new version attached here _query.0.0.3.rm34.zip
--------------------------------------------------------------------------------
Quan VN wrote:
> For redmine 3.4, please use the version at
> https://www.redmine.org/plugins/boolean_query
> Or use new version attached here _query.0.0.3.rm34.zip

Excellent! Thank you!
--------------------------------------------------------------------------------
+1

It could be great to allow filters with multiple conditions by same field (e.g. status is "open" AND status is not feedback) also.
--------------------------------------------------------------------------------
+1 :}
--------------------------------------------------------------------------------
Would it be possible to select the same field twice, so I can query "Due in the next 14 days or due date none" ?
Seems like the field is greyed out once it is selected.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Hi, I have developed this feature in my company, I will try to bring it as a plugin.
--------------------------------------------------------------------------------
is there an plugin version for 4.0? On the plugin site itself it tells me an 404?

Both https://www.redmine.org/plugins/boolean_query
and https://www.redmine.org/plugins/_query deliver 404
--------------------------------------------------------------------------------
As far as I know there is no version for 4.0 available. But you could keep an eye on "mbideau/redmine_zquery":https://github.com/mbideau/redmine_zquery. There even is an issue for "redmine 4.xx support":https://github.com/mbideau/redmine_zquery/issues/3.

Andreas Michel wrote:
> is there an plugin version for 4.0?

--------------------------------------------------------------------------------
Tobias Schmidt wrote:
> As far as I know there is no version for 4.0 available. But you could keep an eye on "mbideau/redmine_zquery":https://github.com/mbideau/redmine_zquery. There even is an issue for "redmine 4.xx support":https://github.com/mbideau/redmine_zquery/issues/3.
>
> Andreas Michel wrote:
> > is there an plugin version for 4.0?

But "mbideau/redmine_zquery":https://github.com/mbideau/redmine_zquery is an older version and does not suppport Redmine 3.4 as _query version 0.0.3 posted in #42 by Quan VN.
--------------------------------------------------------------------------------
We are using OR filter in our work heavily and I have to upgrade our Ubuntu server and Redmine periodically.
With the last Ubuntu upgrade to 18.04 LTS Ruby 2.5 and Rails 5.2 was introduced. This versions are supported by Redmine 4.x only and I don't want maintain old versions of Ruby and Rails on our system.
So I have upgrade to Redmine 4.x.

I'm not a Ruby and Ruby on Rails developer but these are my first steps and with help of article https://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/ I could modify the plugin to work with Redmine 4.x because @alias_method_chain@ and other methods has been removed with Rails 5.
I don't know how to integrate the new Query.operators _match_ and _not match_ in the new plugin implementation because there is no initializer/method for that.
So I removed these new operators because they are not required for the OR filters and are subjects for a separate plugin or patch to Query.statement. The latter is to prefer.
The second reason why I removed the new operators is that it's not clear where they come from.

Further I've changed the names of the or filters for a better understandability and moved the text into translation files and added german translations.
* Any follow (AND) -> AND any following
* Any follow (OR) -> OR any following
* All follow (OR) -> OR all following

You can easily change the names by updating plugins/_query/config/locals/en.yml or adding further translations if you desire.

So I offer a plugin update for Redmine 4, see _query.0.0.4.redmine4x.tar.gz. Tested on Ubuntu 18.04 with Redmine 4.0.4.

I don't think that the plugin works with Redmine 3.4 because of the modifications besides alias_method_chain. I havn't tested it with Redmine 3.4.

By the way the implementation is really a quick and dirty hack because it overwrites the Query.statement method. Any changes in the core Query.statement implementation won't be considered by this plugin unless an update is made.
I'll try to create a patch to Redmine core with functionality as this plugin provides, so that this plugin is not required any longer.
--------------------------------------------------------------------------------
Thanks for Your work.

Unfortunately the two methods match and not match introduce the logical operators inside the string fields. For example, if I want to search for a more then a string in a field in OR:

Description match string1 ~ string2 ~ string3 ~ string4

I obtain as result all issues that contain at least one of the four strings in field Description

--------------------------------------------------------------------------------
giorgio rossi wrote:
> Thanks for Your work.
>
> Unfortunately the two methods match and not match introduce the logical operators inside the string fields. For example, if I want to search for a more then a string in a field in OR:
>
> Description match string1 ~ string2 ~ string3 ~ string4
>
> I obtain as result all issues that contain at least one of the four strings in field Description

I've read the readme and now understand what the operators _match_ and _not match_ do.
They have nothing to do with the or filters but are useful extensions for the queries. But I still don't know how to implement the new operators in the _query plugin. Sorry.
--------------------------------------------------------------------------------
I've found a simple solution to get _match_ operators implemented in @_query@ plugin.
So container @_query.0.0.5.redmine4x.tar.gz@ includes or filters and _match_ operators that works with Redmine 4.x.
--------------------------------------------------------------------------------
I've made patches to integrate the _or filters_ and _match operators_ into redmine core.
So the _query plugin is obsolete with this patches.

The provided patch files has to be applied in the correct order and are based on svn revision 18620. First, issue4339_orfilter.patch and then issue4939_match_operators.patch.

The usage of or-filter and match operators should be added to the Redmine wiki [[https://www.redmine.org/projects/redmine/wiki/RedmineIssueList]] because without an usage descriptions the full power of the match operators are unknown. Therefore I added the README.txt of _query plugin which describes it.
--------------------------------------------------------------------------------
Fantastic job!!
Thanks You
--------------------------------------------------------------------------------
Is anybody in contact with Jean-Philippe Lang so this has a change to get merged?

The filter options need to be much more poerfull...
--------------------------------------------------------------------------------
Hi,

Can you put some screen captures to be able to see how it works and how it changes the native behavior ?
--------------------------------------------------------------------------------
h2. All issues

All issues to compare the examples:
!screencapture_matchop_all-issues.jpg!

h2. Or filter example

One of the or filter (AND any following) in action. In the Add filter dropdown they are grouped in section _OR filters_.
In the filter section Author and Assignee are added to the or filter _AND any following_ (@AND (Author OR Assignee)@). The result shows the issues where Dave Lopper is either Assignee or Author.
!screencapture_orfilter.jpg!

h2. Match operator examples

*Please see README.txt that describes the usage of or filter and match operators.*

A simple example that uses the _match_ filter:
!screencapture_matchop_match-simple.jpg!

A simple example that uses the _not match_ filter, the opposite of simple match filter example:
!screencapture_matchop_notmatch-simple.jpg!

A more complex example that uses the _match_ filter:
!screencapture_matchop_match-complex.jpg!

I hope this screen captures helps.

--------------------------------------------------------------------------------
Thanks Emanuel
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
I second that, JPL (or someone with equivalent competency) should review and merge.
This is extremely useful!
--------------------------------------------------------------------------------
Thanks for useful patch.
http://www.redmine.org/issues/4939#note-56

I hope a lot of people have confirmed that this feature works and get it incorporated into RedmineCore as soon as possible.

However, the latest trunk rev19405 could not apply this patch.
To make it easier to try, I created a branch on my repository and patched it.

https://github.com/y503unavailable/redmine/tree/feature-patch4939

https://github.com/redmine/redmine/compare/master...y503unavailable:feature-patch4939.patch

In this code, I checked the operation of the or-filter function.

I added a Japanese term file patch.
But,created Tentatively.

---

The following branch publishes the 4.2-stable with this issue and the patch of issue 5358 applied.
I update every month for the latest trunk.

https://github.com/y503unavailable/redmine/tree/feature-unofficialcooking

Share Issues Categories for sub-projects
https://www.redmine.org/issues/5358

--------------------------------------------------------------------------------
+1 for this feature
--------------------------------------------------------------------------------
+1 for this feature (to create a simple filter: assignee OR watcher)

--------------------------------------------------------------------------------
Yes, yes, yes +1 :-) ;-)
--------------------------------------------------------------------------------
Being able to set the boolean operators would be very useful
+1 for this feature

--------------------------------------------------------------------------------
Johannes Heymann wrote:
> Being able to set the boolean operators would be very useful
> +1 for this feature

+1 for this feature
--------------------------------------------------------------------------------
+1 too
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1, I want this feature too!

*2021-02-04*:
I merge the patch into latest Redmine 4.x with a branch called @logical-filters@, check it out here
https://github.com/sweihub/redmine/tree/logical-filters

But still pity for each filter can only be used once.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
https://www.redmine.org/issues/4939#note-56
for this patch really need ability to use the same column more than once
for be able to use simple filter like
Target OR Target

And espessially for OR in Tags - really can't use this feature for full without deep filtration
--------------------------------------------------------------------------------
+1

Not clear to me whether this feature have been incorporated into the RedmineCore or not (?)
--------------------------------------------------------------------------------
+1
+1
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 for this but more logical operators for filters in general also multiple conditions for the same field.

How can this basic functionality not have been prioritized after all these years (11 years!)?

I'm trying to create filters to create a simple Eisenhower Matrix: [[https://todoist.com/productivity-methods/eisenhower-matrix]] with the help of <pre>tags</pre> but I fail since cannot create the condition:
<pre>tag is "Important" AND tag is "Urgent"</pre> for a logical AND. But I can only create a logical OR.

Please prioritize!
--------------------------------------------------------------------------------
+1
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------


related_issues

relates,New,10999,Ticket list filter: More flexible filter conditions
duplicates,Closed,7641,Issue filter with OR semantic additional to current AND semantic
duplicates,Closed,12970,Implement the "OR" operator in queries
duplicates,Closed,6332,"OR" filter and not only "AND" filter
duplicates,Closed,10421,Filter with OR conditions
duplicates,Closed,21532,Adding OR and XOR request to REST API and issue filters
duplicates,Closed,23211,Issue filter menu should have different logical operators like "AND", "OR", ...
duplicates,Closed,23216,Issues List, Enhanced Filtering - Allowing Multiple Queries & "OR"-type constraints
duplicates,Closed,34793,Filter OR / AND for issues and repeated columns in filter settings

Admin Redmine さんが3ヶ月前に更新

  • カテゴリIssues filter_56 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0