TicketQuery: filter by one keywords, exclude other keyword

19 views
Skip to first unread message

Florian Schricker

unread,
Feb 21, 2017, 2:40:30 AM2/21/17
to Trac Users
Hi everybody,

I do not know whether this is possible at all but I dare asking: Is it possible to setup a TicketQuery macro to include tickets with a specific keyword (keywords~=word1) but excluding all tickets which contain another specific keywords (keywords!=word2)?

It seems this is not supported - or it's me not able to get it to work.

Any guidance would be very much appreciated,
regards, Florian

Peter Suter

unread,
Feb 21, 2017, 5:19:19 AM2/21/17
to Trac Users
Hi


On Tuesday, February 21, 2017 at 8:40:30 AM UTC+1, Florian Schricker wrote:

I do not know whether this is possible at all but I dare asking: Is it possible to setup a TicketQuery macro to include tickets with a specific keyword (keywords~=word1) but excluding all tickets which contain another specific keywords (keywords!=word2)?

Yes, it is possible and easy, but not at all obvious from the documentation. The trick (mentioned in https://trac.edgewall.org/ticket/10152 only?) is to use a - (dash, minus sign) for the excluded word2 in the same keywords clause:
[[TicketQuery(keywords~=word1 -word2)]]

Regards,
Peter

RjOllos

unread,
Feb 23, 2017, 8:29:04 PM2/23/17
to Trac Users
I added some documentation. Feel free to improve on my attempt.

- Ryan
Reply all
Reply to author
Forward
0 new messages