[rt-users] Eliminate "...Priority changed..." messages when running EscalatePriority

Andy Harrison aharrison at gmail.com
Wed Dec 22 16:05:04 EST 2004


> #               Mon Nov 01 21:10:11 2004        root - Priority changed from 78 to 80

It's done right in the RT::Action::EscalatePriority perl module, down
where runs the $RT::Logger.
 
> 2) More importantly, it changes who last updated the ticket.  I'm planning on using the information on who last updated the tickets to highlight tickets that have been updated most recently by the requestor, and this kills the ability to do that.

Instead of doing it this way, take it from the last ticket update
transaction.  Comments and Replys are always of the transaction types
'Comment' or 'Correspond' though sometimes you'll see 'CustomField' if
that's the only thing the person updated.

Something along the lines of:

%           my $TicketsObj = new RT::Tickets( $RT::SystemUser ); 
%           # or $session{ 'CurrentUser' } instead of the system user.

% # provide some limits or however you prefer to do it...
%
%           $TicketsObj->LimitQueue( VALUE => $Queue );
%           # ... other limits

%           while ( my $CurrentTicketObj = $TicketsObj->Next ) {
%               my $CurrentTransactionsObj = $CurrentTicketObj->Transactions;
%               while ( my $CurrentTicketTransactionObj =
$CurrentTransactionsObj->Next ) {
%                   if (    
%                           $CurrentTicketTransactionObj->Type eq 'Comment' ||
%                           $CurrentTicketTransactionObj->Type eq
'Correspond' ||
%                           $CurrentTicketTransactionObj->Type eq 'CustomField' 
%                       ) {
%                           ...  your code ...
%                       }

-- 
Andy Harrison



More information about the rt-users mailing list