Edgewall Software
Modify

Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#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 anonymous, 15 years ago

Summary: TracQuery - "or"-type filtering with multiple fieldsTicketQuery - "or"-type filtering with multiple fields

comment:2 by anonymous, 15 years ago

I was hoping that

[[TicketQuery(summary~=foo|description~=foo)]]

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.

comment:3 by Remy Blank, 15 years ago

Resolution: duplicate
Status: newclosed

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 steverweber@…, 11 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 anonymous, 11 years ago

Resolution: duplicate
Status: closedreopened

comment:6 by anonymous, 11 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 Remy Blank, 11 years ago

Resolution: duplicate
Status: reopenedclosed

Well, we hate wasting our time, too…

comment:8 by steverweber@…, 11 years ago

it seems the or trick that I thought worked was not true… Perhaps one of the devs can take a look?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.