Sorting history in descending order

Hello. I would like to see ticket history sorted in descending order, with
the most recent transactions on top, and the oldest at the bottom. I can’t
find a reference to this in the docs. How can I get it done?

Thanks!

Chago

In RTv3.0.x, take a look at the “Search” → “Refine search” → “Sort results
by”.

-alexOn Wed, 11 Feb 2004, Adolfo Santiago wrote:

Date: Wed, 11 Feb 2004 10:26:46 -0500
From: Adolfo Santiago mailbag@anothernet.com
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Sorting history in descending order

Hello. I would like to see ticket history sorted in descending order, with
the most recent transactions on top, and the oldest at the bottom. I can’t
find a reference to this in the docs. How can I get it done?

Thanks!

Chago


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Adolfo Santiago wrote:

Hello. I would like to see ticket history sorted in descending order, with
the most recent transactions on top, and the oldest at the bottom. I can’t
find a reference to this in the docs. How can I get it done?

I’ve used the following code in Ticket/Elements/ShowHistory, My changes were for RT2, but it seems to work in RT3.

You need to add an Order by

<%INIT>

my $Transactions = $Ticket->Transactions;

order by here

$Transactions->OrderBy( ALIAS => ‘main’,
FIELD => ‘Created’,
ORDER => ‘DESC’);
my $i;

I implemented this code in RT 3.0.8 and it works great! Thanks!

Chago