OnMaxPriority

From Request Tracker Wiki
Revision as of 14:46, 18 June 2016 by Rabin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I use this very simple Custom action to check if ticket has maximum priority and thus is overdue. When it's true, I send email to someone, that ticket needs to be done.

my $status = $self->TicketObj->Status;
my $final = $self->TicketObj->FinalPriority;
my $priority = $self->TicketObj->Priority;
return 0 unless $self->TransactionObj->Field eq 'Priority';
return 0 unless $status eq 'open' || $status eq 'new' || $status eq 'stalled';
return 0 unless $final > 0;
return 0 unless $final == $priority;
return 1;

For this solution to work, the us of rt-crontool is needed, like this one:

$ crontab -l

# m h         dom mon dow   command
  0 6,12,18,0 *   *   *     rt-crontool --search RT::Search::FromSQL --search-arg "(Status='new' OR Status='open') AND FinalPriority > 0" --action RT::Action::LinearEscalate
 

This line escalate ticket's priority in every queue (if the FinalPriority is set) using rt-crontool every 6 hours. I use LinearEscalate, whis makes much more sense than EscalatePriority.