In RT code many constructions like $self->TicketsObj->Limit* - limit sql query in some params.
I try use construction
$self->TicketsObj->LimitPriority(VALUE => “FinalPriority”, OPERATOR => “<”);
I think it’d be better to make a new action /local/lib/RT/EscalatePriorityBasedOnFinalPriority.pm where you copy the content of EscalatePriority but add a check to see if the action should run based on the Final priority of the ticket
and found tickets that used priority. But this search will also include tickets with Priority==FinalPriority and you will need to drop them into action.
SQL
select id from Tickets where (Status = ‘open’ OR Status = ‘new’ OR Status = ‘stalled’) and ‘Priority’ < FinalPriority;
do what I want. How to generate this sql in RT code?
$self->TicketsObj->FromSQL(“( Status = ‘open’ OR Status = ‘new’ OR Status = ‘stalled’ ) AND ( Priority < FinalPriority )”);
and got the error:
Couldn’t parse query: Wrong query, expecting a VALUE in ‘( Status = ‘open’ OR Status = ‘new’ OR Status = ‘stalled’ ) AND ( Priority < >FinalPriority<–here )’ at /
opt/rt4/bin/…/lib/RT/Tickets.pm line 3036, line 522. (/opt/rt4/bin/…/lib/RT/Tickets.pm:3213)