Before I attempt to reinvent the wheel, I was wondering if anyone had written a reporting script that did something such as listing the numbers and subjects of all open and new tickets. I found something on the wiki, but it requires manual input of ticket numbers.
I also have some rudimentary scripting using the RT pms, but any pre-existing code would save time. Thanks!
Kimberly McKinnis
System Operations Engineer
Service Provider Division, TiVo Inc
408-519-9607
Do you need script? In the RT web ui you can use Charts for that. As
well, you can re-use code from the latest version of
share/html/Search/Elements/Chart
my $Query = “Queue = ‘X’”;
use RT::Report::Tickets;
my $tix = RT::Report::Tickets->new( $session{‘CurrentUser’} );
my ($count_name, $value_name) = $tix->SetupGroupings(
Query => $Query, GroupBy => ‘Status’,
);
while ( my $entry = $tix->Next ) {
my $status = $entry->__Value( $value_name );
my $count = $entry->__Value( $count_name );
print “$status => $count\n”;
}
I think this code should work, but I’m not sure if SetupGroupings
method is part of RT 3.8.4 or not. Implemented it recently to simplify
things and make it possible to group by multiple columns.On Fri, Aug 28, 2009 at 1:42 AM, Kimberly McKinniskmckinnis@tivo.com wrote:
Before I attempt to reinvent the wheel, I was wondering if anyone had
written a reporting script that did something such as listing the numbers
and subjects of all open and new tickets. I found something on the wiki, but
it requires manual input of ticket numbers.
I also have some rudimentary scripting using the RT pms, but any
pre-existing code would save time. Thanks!
I guess I should be more specific. Our PMs would like to have this info automated and emailed, instead of cutting and pasting it from the query builder in RT. Thanks!From: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]
Sent: Thursday, August 27, 2009 3:10 PM
To: Kimberly McKinnis
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Reporting: List of new/open tickets?
Hello Kimberly,
Do you need script? In the RT web ui you can use Charts for that. As
well, you can re-use code from the latest version of
share/html/Search/Elements/Chart
my $Query = “Queue = ‘X’”;
use RT::Report::Tickets;
my $tix = RT::Report::Tickets->new( $session{‘CurrentUser’} );
my ($count_name, $value_name) = $tix->SetupGroupings(
Query => $Query, GroupBy => ‘Status’,
);
while ( my $entry = $tix->Next ) {
my $status = $entry->__Value( $value_name );
my $count = $entry->__Value( $count_name );
print “$status => $count\n”;
}
I think this code should work, but I’m not sure if SetupGroupings
method is part of RT 3.8.4 or not. Implemented it recently to simplify
things and make it possible to group by multiple columns.
I guess I should be more specific. Our PMs would like to have this info automated and emailed, instead of cutting and pasting it from the query builder in RT. Thanks!
So they want to use a dashboard. Point them at it
(assuming you’re using a modern version of RT) and let them have fun.
Cambridge Energy Alliance: Save money. Save the planet.
Hi Kimberly,
We use dashboards to automate the emailing of new/open lists each
morning. Perhaps that might work for you?
Sean
Kimberly McKinnis wrote:
I guess I should be more specific. Our PMs would like to have this info automated and emailed, instead of cutting and pasting it from the query builder in RT. Thanks!
Do you need script? In the RT web ui you can use Charts for that. As
well, you can re-use code from the latest version of
share/html/Search/Elements/Chart
my $Query = “Queue = ‘X’”;
use RT::Report::Tickets;
my $tix = RT::Report::Tickets->new( $session{‘CurrentUser’} );
my ($count_name, $value_name) = $tix->SetupGroupings(
Query => $Query, GroupBy => ‘Status’,
);
while ( my $entry = $tix->Next ) {
my $status = $entry->__Value( $value_name );
my $count = $entry->__Value( $count_name );
print “$status => $count\n”;
}
I think this code should work, but I’m not sure if SetupGroupings
method is part of RT 3.8.4 or not. Implemented it recently to simplify
things and make it possible to group by multiple columns.
Before I attempt to reinvent the wheel, I was wondering if anyone had
written a reporting script that did something such as listing the numbers
and subjects of all open and new tickets. I found something on the wiki, but
it requires manual input of ticket numbers.
I also have some rudimentary scripting using the RT pms, but any
pre-existing code would save time. Thanks!
anyone had written a reporting script that did something such as listing the numbers and subjects of all open
and new tickets… Our PMs would like to have this info automated and emailed
Why not use the “Dashboards” that are already built into RT?
Click “Tickets” do create a search for new and open tickets (and
whatever other criteria). Save the search with Group permissions so
all the PMs can access it too. Then create a Dashboard using that
saved search, which all the PMs can subscribe to. Once a person is
subscribed to that Dashboard, they will get an email about it
regularly.
Before creating the saved search, you need the right perms to save for
a group. Use the RT root user if you’re unsure. The PMs will each need
the “SubscribeDashboard” right too.