#8066 closed enhancement (duplicate)
TicketQuery - "or"-type filtering with multiple fields
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | 0.11.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I want to make a TicketQuery that checks for the same term in multiple fields, e.g. summary~=foo
and description~=foo
and returns any tickets that match in either.
If I write
[TicketQuery(summary~=foo,description~=foo)]]
the query returns only tickets that have the search term in both the fields listed. This is frequently the desired behaviour, but not in my use case; I would like the TicketQuery to return tickets containing 'foo' in either field.
I tried this but it failed with a syntax error from the macro:
[[TicketQuery(summary|description~=foo)]]
which I expected. Also such a notation won't work if you want 'or' queries for different terms, e.g. with summary~=foo
or description~=bar
.
I don't think this is #5226 or #7558.
Perhaps it's just something I'm missing in the documentation, if you can point that out I'm happy to go fix that.
Attachments (0)
Change History (8)
comment:1 by , 16 years ago
Summary: | TracQuery - "or"-type filtering with multiple fields → TicketQuery - "or"-type filtering with multiple fields |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I'll mark this one as a duplicate of #2647, and I'll make a note there that the TicketQuery
macro also needs adaptation.
comment:4 by , 12 years ago
After reviewing the TicketQuery wiki I still don't understand how to preform something like:
=== My open tickets === [[TicketQuery(owner=$USER [@@[OR]@@] reporter=$USER,status!=closed,order=id,desc=1,format=table,col=summary|reporter|owner|milestone|created|modified)]]
Note how the owner or reporter define if the ticket is /yours/.
Is this TicketQuery possible?
comment:5 by , 12 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
comment:6 by , 12 years ago
Found solution
[[TicketQuery(status!=closed,reporter=$USER,or,owner=$USER,status!=closed,order=id,desc=1,format=table,col=summary|reporter|owner|milestone|created|modified)]]
you can use the keyword 'or' the filter seems to evaluate like… (status!=closed,reporter=$USER) or (owner=$USER,status!=closed)
It would be nice to see this on the wiki to save others from pain.
Also would be nice to see on the wiki… a short example of format=progress
[[TicketQuery(milestone=3.0,format=progress)]]
I would add it to the wiki myself… but last time I made changes they got reverted and I HATE wasting my time.
Thanks.
comment:7 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Well, we hate wasting our time, too…
comment:8 by , 12 years ago
it seems the or trick that I thought worked was not true… Perhaps one of the devs can take a look?
I was hoping that
would allow this kind of querying, but I see
|
is already used to separate multiple match values in each filter field, so tweaking the parsing to allow the syntax could get tricky.