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

Beachey, Kendric Kendric.Beachey at garmin.com
Wed Feb 13 11:39:08 EST 2002


> -----Original Message-----
> From: Bruce Campbell [mailto:bruce_campbell at ripe.net]
> 
> On Wed, 13 Feb 2002, Beachey, Kendric wrote:
> 
> > my $Transactions = $Ticket->Transactions;
> >
> > if ($Ticket->QueueObj->Name == 'webrequest')
> 
> '==' is a binary numeric comparison, and in the above 
> essentially resolves
> to 'if( 1 == 1 )'.  Try instead:
> 
> 	if( $Ticket->QueueObj->Name =~ /webrequest/i )
> 
> Although I'd make it easier for the behaviour to be extended to other
> queues in future, and:
> 
> 	my $queues_reverse = "webrequest test example_queue";
> 	if( $queues_reverse =~ /$Ticket->QueueObj->Name/ )

Yay, I got it to work!  Although the above wasn't doing the trick for some
reason, so I tweaked it slightly.  Here is what I came up with:

my $queues_to_reverse = "webrequest general";
my $this_tickets_queue = $Ticket->QueueObj->Name;
if ($queues_to_reverse =~ /$this_tickets_queue/ )
{
        $Transactions->OrderBy (        FIELD => 'id',
                                        ORDER => 'DESC' );
}


Thanks again, Bruce, you da man!
--
Kendric Beachey




More information about the rt-users mailing list