Difference between revisions of "OnMaxPriority"

From Request Tracker Wiki
Jump to navigation Jump to search
m (2 revisions imported)
 
 
Line 13: Line 13:
For this solution to work, the us of rt-crontool is needed, like this one:
For this solution to work, the us of rt-crontool is needed, like this one:


  <nowiki>$ crontab -l
  <pre>
# m h dom mon dow  command
$ crontab -l
0 6,12,18,0 * * * rt-crontool --search RT::Search::FromSQL --search-arg "(Status='new' OR Status='open') AND FinalPriority &gt; 0" --action RT::Action::LinearEscalate
 
# 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 &gt; 0" --action RT::Action::LinearEscalate
   
   
</nowiki>
</pre>


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]].
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]].

Latest revision as of 15:46, 18 June 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.