Reporting: List of new/open tickets?

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

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.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!

~~

Kimberly McKinnis

System Operations Engineer

Service Provider Division, TiVo Inc

408-519-9607


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

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:

Cool. We’re using 3.4.5, I don’t see a dashboard, but this may be an excuse for an upgrade. Thanks guys :)From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of spark
Sent: Thursday, August 27, 2009 3:21 PM
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Reporting: List of new/open tickets?

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!

-----Original Message-----
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.

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


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

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.

See RT 3.8 Tutorial: Dashboards — Best Practical Solutions

A

Probably pointing managament at the following tutorial will help speed upgrade:

http://blog.bestpractical.com/2009/02/rt-38-tutorial-dashboards.htmlOn Fri, Aug 28, 2009 at 2:28 AM, Kimberly McKinniskmckinnis@tivo.com wrote:

Cool. We’re using 3.4.5, I don’t see a dashboard, but this may be an excuse for an upgrade. Thanks guys :slight_smile:

Best regards, Ruslan.