How do I query for empty/nonempty fields in a Trac reposoitory with Mylyn?

330 Views Asked by At

I'm trying to create four distinct queries to a Trac repository from the Mylyn plugin to Eclipse 3.7.1. What I want to do is to divide all tasks into exactly one of the following categories:

  • My problem: non-resolved tickets assigned to me
  • Somebody elses problem: non-resolved tickets assigned to somebody else
  • Nobodys problem (yet): non-resolved, unassigned tickets
  • No problem: resolved tickets

I have no problem creating the first and the last queries, by simply selecting appropriate status and, in the first case, assignee. But the two in the middle are causing problems:

Somebody elses problem: What I'd like here, is all the tickets that are not in status "closed" and assigned to someone who is not me. I tried the following requirements:

  • All statuses except "closed"
  • Owner is not "[my user id]"

But then I get all unassigned tickets as well. I'd lke it to get all tickets that fulfills status != closed && owner != me && owner != '' but it skips the last requirement.

Nobodys problem (yet): Here I'd like all tickets without an assignee, but if I leave the field empty the query creator just ignores it. I'd like status != closed && owner == '', but I only get status != closed.

It seems the problem is including fields in the query with requirements that they are or are not empty, I'm guessing because the form creates the query based on the fields where the user has actually entered some data.

How do I work around this?

1

There are 1 best solutions below

0
On

One thing we did is to create a user named 'nobody'. 'nobody' is the default owner of all new tickets. To query for unassigned tickets, we simply look for all tickets assigned to 'nobody'. This ended up being easier to script and easier to connect to external tools than using owner==''.