[rt-users] Reverse (date) order in Ticket History

Beachey, Kendric Kendric.Beachey at garmin.com
Wed Feb 13 10:40:41 EST 2002


> -----Original Message-----
> From: Bruce Campbell [mailto:bruce_campbell at ripe.net]
> 
> On Sun, 10 Feb 2002, Daniel Schwager wrote:
> 
> > did somebody patched the RT2 code (2-0-11) to
> > show the hostory in a reverse order (means
> 
> > I think, i have to change
> > /opt/rt2/WebRT/html/Ticket/Elements/ShowHistory
> > but i don't know the internal data structure ....
> 
> In the above file, you will need to add ordering to the Transactions
> variable, so after:
> 
> 	my $Transactions = $Ticket->Transactions;
> 
> add:
> 
> 	$Transactions->OrderBy( FIELD => 'id',
> 				ORDER => 'DESC' );
> 
> ( default ordering is ASCending )


Works great!  But I would like to make this happen only on certain queues.
I'm *really* new at hacking RT (as in I started 30 minutes ago), so I
haven't got this working yet.  So far I've got this:


my $Transactions = $Ticket->Transactions;

if ($Ticket->QueueObj->Name == 'webrequest')
{
        $Transactions->OrderBy (        FIELD => 'id',
                                        ORDER => 'DESC' );
}


...which reverses the history order for tickets in all queues, not just
webrequest (which was my aim).  I'm also not that whippy at perl in general,
so it's possible I've made some really doofy error.  What am I missing here?
--
Kendric Beachey




More information about the rt-users mailing list