Hi,
How is the WHERE clause constructed when we call $Tickets->LimitXXXX?
I know it depends on the field type, so if the field type is a date (for example LimitDate method) then “AND” is used. But this ENTRYAGGREGATOR is used between fields of the same type only? And what about fields of different types?
For example, how can I create the following filters:
Status=“new” OR Owner=2
Is the following correct?: $Tickets->LimitStatus(“new”); $Tickets->LimitOwner(2);
or a little more complex (but actually, that’s what I want):
The WHERE Clause is generated by DBIx::SearchBuilder… It isn’t as flexible
as hand-hacking raw sequel. this may or may not be a win. Over time
it’s been getting more and more flexible and will continue to do so.
at some point, dropping in raw SQL clauses should certainly be doable.
I can’t fully divine what your usage scenario is, but
Limiting to (Status = ‘new’ OR Status = ‘open’) AND (Owner = ‘2’ or Owner = $RT::Nobody->Id) may be what you want. If not, can you describe in english
what you’re trying to query for?
-jOn Wed, Aug 01, 2001 at 12:56:10PM +0800, Rafael Corvalan wrote:
Hi,
How is the WHERE clause constructed when we call $Tickets->LimitXXXX?
I know it depends on the field type, so if the field type is a date (for example LimitDate method) then “AND” is used. But this ENTRYAGGREGATOR is used between fields of the same type only? And what about fields of different types?
For example, how can I create the following filters:
Status=“new” OR Owner=2
Is the following correct?: $Tickets->LimitStatus(“new”); $Tickets->LimitOwner(2);
or a little more complex (but actually, that’s what I want):
Just because if they are owned by someone, it should not be “new”. It
was just a personal opinion…
But thinking more in depth, you’re probably right. I can “Take” a ticket
because I know I will work on it, but just “Open” it 1 hour later.
OK, I accept this idea. How can I know (I can do some tests, but I’d
prefer to have a logical way to know it) what will I obtain using:
because of course this doesn’t work, since there is a logicl OR between
the “Status” where clauses, and not an “AND”.
In that case I could inverse and tell Status=“new” or “Status”=“open”
or…
OR you could use ENTRYAGGREGATOR => ‘OR’ in the LimitStatus statements.
But am I sure that between the Owner limit and the status limit I am
using an AND clause?
yes. that’s currently built into SearchBuilder.
-----Original Message-----
From: Jesse [mailto:jesse@fsck.com]
Sent: mercredi, 1. août 2001 07:57
To: Rafael Corvalan
Subject: Re: [rt-users] WHERE clause when using LimitXXX
What I guess I don’t understand is why you want to see tickets that are
owned by someone already and new…
What I had in mind was somewhat different. I was thinking on:
( Owner = $RT::Nobody->Id AND Status != “resolved” AND Status !=
“dead”
)
OR
( Status = “new” )
In fact, I created a new element that I display in index.html. This
element should display every ticket that must be taken or open by
someone in the team. This, in english means:
Tickets not taken (The owner is Nobody) and which status means that
something is still to be done
OR
Tickets taken or not but with Status “new”
In other words, this element should always be empty. If I see
something in this Element, I should immediately ask myself "Is there a
ticket in this element I sould work on"? And if a ticket remains too
much time shown on this element, I should ask to someone in the team
to take it.
I hope I was clear…
-----Original Message-----
From: Jesse [mailto:jesse@fsck.com]
Sent: mercredi, 1. août 2001 07:20
To: Rafael Corvalan
Cc: rt-users@fsck.com
Subject: Re: [rt-users] WHERE clause when using LimitXXX
The WHERE Clause is generated by DBIx::SearchBuilder… It isn’t as
flexible as hand-hacking raw sequel. this may or may not be a win.
Over time it’s been getting more and more flexible and will continue
to do so. at some point, dropping in raw SQL clauses should certainly
be doable.
I can’t fully divine what your usage scenario is, but
Limiting to (Status = ‘new’ OR Status = ‘open’) AND (Owner = ‘2’ or
Owner = $RT::Nobody->Id) may be what you want. If not, can you
describe in english what you’re trying to query for?
-j
Hi,
How is the WHERE clause constructed when we call
$Tickets->LimitXXXX?
I know it depends on the field type, so if the field type is a date
(for example LimitDate method) then “AND” is used. But this
ENTRYAGGREGATOR is used between fields of the same type only? And
what
about fields of different types?
For example, how can I create the following filters:
Status=“new” OR Owner=2
Is the following correct?: $Tickets->LimitStatus(“new”);
$Tickets->LimitOwner(2);
or a little more complex (but actually, that’s what I want):
Correct.On Wed, Aug 01, 2001 at 08:22:04AM +0200, Rafael Corvalan wrote:
Great. So then, are the following assumptions right:
Between two different fields (for example Status and Owner),
the operator used by the SearchBuilder is “AND” and cannot
be overriden.
For a specific field (for example Status), the operator
used depends on the field type, but can be overriden
using ENTRYAGGREGATOR
? Thanks.
-----Original Message-----
From: Jesse [mailto:jesse@fsck.com]
Sent: mercredi, 1. août 2001 08:15
To: Rafael Corvalan
Cc: rt-users@fsck.com
Subject: Re: [rt-users] WHERE clause when using LimitXXX
On Wed, Aug 01, 2001 at 08:11:12AM +0200, Rafael Corvalan wrote:
Just because if they are owned by someone, it should not be “new”. It
was just a personal opinion… But thinking more in depth, you’re
probably right. I can “Take” a ticket because I know I will work on
it, but just “Open” it 1 hour later.
OK, I accept this idea. How can I know (I can do some tests, but I’d
prefer to have a logical way to know it) what will I obtain using:
because of course this doesn’t work, since there is a logicl OR
between the “Status” where clauses, and not an “AND”. In that case I
could inverse and tell Status=“new” or “Status”=“open” or…
OR you could use ENTRYAGGREGATOR => ‘OR’ in the LimitStatus statements.
But am I sure that between the Owner limit and the status limit I am
using an AND clause?
Great. So then, are the following assumptions right:
Between two different fields (for example Status and Owner),
the operator used by the SearchBuilder is “AND” and cannot
be overriden.
For a specific field (for example Status), the operator
used depends on the field type, but can be overriden
using ENTRYAGGREGATOR
? Thanks.From: Jesse [mailto:jesse@fsck.com]
Sent: mercredi, 1. août 2001 08:15
To: Rafael Corvalan
Cc: rt-users@fsck.com
Subject: Re: [rt-users] WHERE clause when using LimitXXX
Just because if they are owned by someone, it should not be “new”. It
was just a personal opinion… But thinking more in depth, you’re
probably right. I can “Take” a ticket because I know I will work on
it, but just “Open” it 1 hour later.
OK, I accept this idea. How can I know (I can do some tests, but I’d
prefer to have a logical way to know it) what will I obtain using:
because of course this doesn’t work, since there is a logicl OR
between the “Status” where clauses, and not an “AND”. In that case I
could inverse and tell Status=“new” or “Status”=“open” or…
OR you could use ENTRYAGGREGATOR => ‘OR’ in the LimitStatus statements.
But am I sure that between the Owner limit and the status limit I am
using an AND clause?