Combine 'and' 'or' in queries - cant do it?

HI all,

I am trying to build a saved search that will show me all tickets that
are over 48 hours old with either no response or update.

So i need to see tickets that are ‘new’ OR ‘open’ AND
created/lastupdates < -48 hours - every time i try to create it - it
only allows me to switch all the or’s to and’s or vice versa…

why is this? Should i not be able to cerate the query above? Am I
missing something obvious? thanks in advance!

Sean Daniels

Not sure if there is a solution to your question, but this should work
as a quick fix:

Status !=‘stalled’
AND Status !=‘rejected’
AND Status !=‘resolved’
AND created/lastupdates < -48 hours

Pat-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of TeleMole
Sent: Monday, May 01, 2006 9:06 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

HI all,

I am trying to build a saved search that will show me all tickets that
are over 48 hours old with either no response or update.

So i need to see tickets that are ‘new’ OR ‘open’ AND
created/lastupdates < -48 hours - every time i try to create it - it
only allows me to switch all the or’s to and’s or vice versa…

why is this? Should i not be able to cerate the query above? Am I
missing something obvious? thanks in advance!

Sean Daniels
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
http://bestpractical.com/about/jobs.html

What I do when I have this problem is get as much of the query as I can
created in the Query Builder, then I click on Advanced and change things
around there (e.g. ANDs to ORs, ORs to ANDs, etc.). This usually gets me
what I want.

Kris-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thornton,
Patrick J
Sent: Monday, May 01, 2006 8:18 AM
To: TeleMole; rt-users@lists.bestpractical.com
Subject: RE: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

Not sure if there is a solution to your question, but this should work
as a quick fix:

Status !=‘stalled’
AND Status !=‘rejected’
AND Status !=‘resolved’
AND created/lastupdates < -48 hours

Pat

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of TeleMole
Sent: Monday, May 01, 2006 9:06 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

HI all,

I am trying to build a saved search that will show me all tickets that
are over 48 hours old with either no response or update.

So i need to see tickets that are ‘new’ OR ‘open’ AND
created/lastupdates < -48 hours - every time i try to create it - it
only allows me to switch all the or’s to and’s or vice versa…

why is this? Should i not be able to cerate the query above? Am I
missing something obvious? thanks in advance!

Sean Daniels
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
http://bestpractical.com/about/jobs.html

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
http://bestpractical.com/about/jobs.html

I tried that - when I clicked on save - the ands and ors were reverted :(On 5/1/06, Kristopher Lusk klusk@brit.com wrote:

What I do when I have this problem is get as much of the query as I can
created in the Query Builder, then I click on Advanced and change things
around there (e.g. ANDs to ORs, ORs to ANDs, etc.). This usually gets me
what I want.

Kris

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thornton,
Patrick J
Sent: Monday, May 01, 2006 8:18 AM
To: TeleMole; rt-users@lists.bestpractical.com
Subject: RE: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

Not sure if there is a solution to your question, but this should work
as a quick fix:

Status !=‘stalled’
AND Status !=‘rejected’
AND Status !=‘resolved’
AND created/lastupdates < -48 hours

Pat

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of TeleMole
Sent: Monday, May 01, 2006 9:06 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

HI all,

I am trying to build a saved search that will show me all tickets that
are over 48 hours old with either no response or update.

So i need to see tickets that are ‘new’ OR ‘open’ AND
created/lastupdates < -48 hours - every time i try to create it - it
only allows me to switch all the or’s to and’s or vice versa…

why is this? Should i not be able to cerate the query above? Am I
missing something obvious? thanks in advance!

Sean Daniels


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
Careers — Best Practical Solutions


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
Careers — Best Practical Solutions

I tried that - when I clicked on save - the ands and ors were reverted :frowning:

IIRC, due to the way the parse tree works, all of the operators in each
set or parens must be the same. Instead of:
(a OR b AND c)
…try the more explicit:
((a OR b) AND c)

  • Alex

How about building the query like this:

  1. Start with the, “created/lastupdates < -48 hours”
  2. Then add, "AND status = ‘new’
  3. While you are still on the “AND status = ‘new’” line, click on the ‘>’
    button beneath your query
  4. Now you should have:
    Created/lastupdates < -48 hours
    AND
    Status = ‘new’
  5. So finally click the OR radio button and add this to the query, “status =
    ‘open’”.
  6. Now you should have:
    Created/lastupdates < -48 hours
    AND
    Status = ‘new’
    OR Status = ‘open’

Is this what you want?

KrisFrom: TeleMole [mailto:telemole@gmail.com]
Sent: Monday, May 01, 2006 9:55 AM
To: Kristopher Lusk
Cc: Thornton, Patrick J; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] combine ‘and’ ‘or’ in queries - cant do it?

I tried that - when I clicked on save - the ands and ors were reverted :frowning: