[Rt-devel] rt-remind

Manuel Stächele manuel at ilch.de
Fri Aug 11 07:27:47 EDT 2006


hi list,

i have a question to the rt-remind modul but i think the question is
realy general.

it is possible to build a query like this:

WHERE quenname = 'x'
AND (
  status = 'new' OR status = 'open'
)
AND (
  starts < '2006-08-11' OR due < '2006-08-11' OR priority > 70
)

----

i test a lot but can't figure it out.

my tests:

    my $tickets = new RT::Tickets($RT::SystemUser);

    $tickets->LimitQueue(VALUE => $queue->Id);
    $tickets->Limit(ENTRYAGGREGATOR => 'AND');
    $tickets->_OpenParen();
    $tickets->LimitStatus(VALUE => 'new');
    $tickets->Limit(ENTRYAGGREGATOR => 'OR');
    $tickets->LimitStatus(VALUE => 'open');
    $tickets->_CloseParen();

    $tickets->Limit(ENTRYAGGREGATOR => 'AND');

    $tickets->_OpenParen();
    $tickets->LimitStarts(OPERATOR => '<', VALUE => 'now +'.$plusdays.' day');
    $tickets->Limit(ENTRYAGGREGATOR => 'OR');
    $tickets->LimitDue(OPERATOR => '<', VALUE => 'now +'.$plusdays.' day');
    $tickets->Limit(ENTRYAGGREGATOR => 'OR');
    $tickets->LimitPriority(OPERATOR => '>', VALUE => $mpriority);
    $tickets->_CloseParen();

    $tickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');

i thought OpenParen and CloseParen can group the terms and
ENTRYAGGREGATOR can set the AND or the OR operator but do not relay
work.
in principle it work but the last three terms (starts, due, priority)
are added with AND not with OR...

someone have a solution?

would be nice, thanks

greetings manuel


More information about the Rt-devel mailing list