Sorting records in report using Weekly.html

Man, I must be really obtuse, because I can’t get this thing to work. How
do I sort by Ticket ID in this report? I tried the TicketsSortOrder method,
Orderby method, and again, I can’t seem to find the right combination. I
assume it should go somewhere in here:

my $tickets = new RT::Tickets($RT::SystemUser);

$tickets->LimitTransactionDate( VALUE => $startobj->ISO, OPERATOR => 

‘>=’);
$tickets->LimitTransactionDate( VALUE => $endobj->ISO, OPERATOR =>
’<=’);
$tickets->LimitStatus( VALUE => ‘open’, OPERATOR => ‘=’);
while (my $ticket = $tickets->Next()) {
my $transes = $ticket->Transactions();
$transes->Limit( FIELD => ‘Created’,
VALUE => $startobj->ISO,
OPERATOR => ‘>=’,
ENTRYAGGREGATOR=> ‘AND’ );

$transes->Limit(    FIELD => 'Created',
                    VALUE => $endobj->ISO,
                    OPERATOR => '<=',
                    ENTRYAGGREGATOR => 'AND');
$transes->_DoSearch();
next unless ($transes->Count > 0);

But I’m damned if I can figure it out. Looking at some of the other places
where the order is set has only confused me more.

Help!

Thanks
Tom

How do I sort by Ticket ID in this report? I tried the
TicketsSortOrder method, Orderby method, and again, I can’t seem to
find the right combination. I assume it should go somewhere in here:

Looking through RT::Interface::Web::ProcessSearchQuery seems to
indicate:

my $tickets = new RT::Tickets($RT::SystemUser);

$tickets->LimitTransactionDate( VALUE => $startobj->ISO, OPERATOR =>
’>=’);
$tickets->LimitTransactionDate( VALUE => $endobj->ISO, OPERATOR =>
’<=’);
$tickets->LimitStatus( VALUE => ‘open’, OPERATOR => ‘=’);

$tickets->OrderBy(FIELD => 'Created',
                  ORDER => 'DESC');

Substitute variable values for ‘Created’ and ‘DESC’, of course.

(darren)

All truth passes through three stages: first, it is ridiculed;
next it is violently attacked; finally, it is held to be self-evident.
– Schopenhauer

Yup, that did it. Perhaps I should just ask you directly next time? :slight_smile:

What is the RT::Interface that you mentioned below? I have been trying to
find a source of info on how to do what I’m doing but haven’t found much.

Thanks again
Tom–On Wednesday, February 19, 2003 3:02 PM -0500 darren chamberlain darren@boston.com wrote:

How do I sort by Ticket ID in this report? I tried the
TicketsSortOrder method, Orderby method, and again, I can’t seem to
find the right combination. I assume it should go somewhere in here:

Looking through RT::Interface::Web::ProcessSearchQuery seems to
indicate:

my $tickets = new RT::Tickets($RT::SystemUser);

$tickets->LimitTransactionDate( VALUE => $startobj->ISO, OPERATOR =>
’>=’);
$tickets->LimitTransactionDate( VALUE => $endobj->ISO, OPERATOR =>
’<=’);
$tickets->LimitStatus( VALUE => ‘open’, OPERATOR => ‘=’);

$tickets->OrderBy(FIELD => 'Created',
                  ORDER => 'DESC');

Substitute variable values for ‘Created’ and ‘DESC’, of course.

(darren)


All truth passes through three stages: first, it is ridiculed;
next it is violently attacked; finally, it is held to be self-evident.
– Schopenhauer


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

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

Yup, that did it. Perhaps I should just ask you directly next time? :slight_smile:

The answers (and praise, hint hint :wink: go into the archives, though…

What is the RT::Interface that you mentioned below? I have been trying
to find a source of info on how to do what I’m doing but haven’t found
much.

In the past, I’ve spent some time poking about in $RT/lib;
RT::Interface::{Web,Email,CLI} define helper functions and other Useful
Things relevant to specific interfaces to RT. In this case, I looked in
WebRT/html/Search/Listing.html, saw that the arg processing was handled
by ProcessSearchQuery, and then ran:

find $RT/lib -name *.pm -print | xargs grep ProcessSearchQuery

(find | xargs grep is your friend!)

Warning: We’re running an old (2.0.0 pre15!) version of RT, so what I’m
telling you might be out of date.

(darren)

Everybody wants to go to heaven, but nobody wants to die.
– Peter Tosh

I looked in Listing.html, but I didn’t know where to go from there. And I
am no stranger to find and xargs grep, trust me… :slight_smile: I just couldn’t
figure out what to look for from there. I’m a Sun/Linux admin by trade,
hacker by necessity…

Tom–On Wednesday, February 19, 2003 3:15 PM -0500 darren chamberlain darren@boston.com wrote:

Yup, that did it. Perhaps I should just ask you directly next time? :slight_smile:

The answers (and praise, hint hint :wink: go into the archives, though…

What is the RT::Interface that you mentioned below? I have been trying
to find a source of info on how to do what I’m doing but haven’t found
much.

In the past, I’ve spent some time poking about in $RT/lib;
RT::Interface::{Web,Email,CLI} define helper functions and other Useful
Things relevant to specific interfaces to RT. In this case, I looked in
WebRT/html/Search/Listing.html, saw that the arg processing was handled
by ProcessSearchQuery, and then ran:

find $RT/lib -name *.pm -print | xargs grep ProcessSearchQuery

(find | xargs grep is your friend!)

Warning: We’re running an old (2.0.0 pre15!) version of RT, so what I’m
telling you might be out of date.

(darren)


Everybody wants to go to heaven, but nobody wants to die.
– Peter Tosh


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

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