OnMaxPriority: Difference between revisions

From Request Tracker Wiki
Jump to navigation Jump to search
m (2 revisions imported)
(No difference)

Revision as of 15:15, 6 April 2016

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.