Emmanuel Lacour schrieb: > On Sat, Aug 16, 2008 at 11:26:04PM +0200, Rainer Duffner wrote: > >> Hi, >> >> I'd like to have statistics that list - per queue - which requestors >> requested how many tickets. >> >> Is that possible? >> >> > > Yes, make a search for all tickets in the wanted queue on the web UI, > then at the bottom of the result (list of tickets), you will see "Chart > 'bar' by 'status'". Changes "status" to "requestor" and click on "Go". > > You will get a chart on the count of tickets per requestor for this > queue. > >
OK, this works for e.g. Status. But when I select "Requestor" from the drop-down, I get a quasi-empty chart and this in the log: [Tue Aug 19 08:50:12 2008] [warning]: DBD::Pg::st execute failed: ERROR: column "users_5.name" must appear in the GROUP BY clause or be used in an aggregate function at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 505. (/usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm:505) [Tue Aug 19 08:50:12 2008] [warning]: RT::Handle=HASH(0xb75825c) couldn't execute the query 'SELECT DISTINCT COUNT(main.id) AS id, Users_5.Name AS col1 FROM Tickets main JOIN Groups Groups_1 ON ( Groups_1.Domain = 'RT::Ticket-Role' ) AND ( Groups_1.Type = 'Requestor' ) AND ( Groups_1.Instance = main.id ) LEFT JOIN CachedGroupMembers CachedGroupMembers_2 ON ( CachedGroupMembers_2.GroupId != CachedGroupMembers_2.MemberId ) AND ( CachedGroupMembers_2.GroupId = Groups_1.id ) LEFT JOIN CachedGroupMembers CachedGroupMembers_4 ON ( CachedGroupMembers_4.GroupId != CachedGroupMembers_4.MemberId ) AND ( CachedGroupMembers_4.GroupId = Groups_1.id ) LEFT JOIN Users Users_3 ON ( Users_3.id = CachedGroupMembers_2.MemberId ) LEFT JOIN Users Users_5 ON ( Users_5.id = CachedGroupMembers_4.MemberId ) WHERE (main.Status != 'deleted') AND (main.Status != 'rejected' AND main.Created > '2008-07-31 22:00:00') AND (main.Type = 'ticket') AND (main.EffectiveId = main.id) GROUP BY Users_3.Name ' at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 518 DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0xb75825c)', 'SELECT DISTINCT COUNT(main.id) AS id, Users_5.Name AS col1 FR...') called at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder.pm line 238 DBIx::SearchBuilder::_DoSearch('RT::Report::Tickets=HASH(0xc54732c)') called at /usr/local/rt38/bin/../lib/RT/Report/Tickets.pm line 164 RT::Report::Tickets::_DoSearch('RT::Report::Tickets=HASH(0xc54732c)') called at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder.pm line 498 DBIx::SearchBuilder::Next('RT::Report::Tickets=HASH(0xc54732c)') called at /usr/local/rt38/bin/../lib/RT/Report/Tickets.pm line 228 RT::Report::Tickets::Next('RT::Report::Tickets=HASH(0xc54732c)') called at /usr/local/rt38/share/html/Search/Elements/Chart line 71 HTML::Mason::Commands::__ANON__('ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, 'SecondaryGroupBy', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xc5474e8)', 'ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1278 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1268 HTML::Mason::Request::comp('undef', 'undef', 'ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', ...) called at /usr/local/rt38/share/html/Search/Chart.html line 70 HTML::Mason::Commands::__ANON__('Rows', 50, 'PrimaryGroupBy', 'Requestor', 'Format', '\' <b><a href="__WebPath__/Ticket/Display.html?id=__id__">_...', 'Order', 'ASC|ASC|ASC|ASC', 'ChartStyle', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xc2bc8d4)', 'Rows', 50, 'PrimaryGroupBy', 'Requestor', 'Format', '\' <b><a href="__WebPath__/Ticket/Display.html?id=__id__">_...', 'Order', 'ASC|ASC|ASC|ASC', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1278 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1268 HTML::Mason::Request::comp('undef', 'undef', 'undef', 'Rows', 50, 'PrimaryGroupBy', 'Requestor', 'Format', '\' <b><a href="__WebPath__/Ticket/Display.html?id=__id__">_...', ...) called at /usr/local/rt38/share/html/autohandler line 308 HTML::Mason::Commands::__ANON__('ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, 'PrimaryGroupBy', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbc32400)', 'ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1273 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1268 HTML::Mason::Request::comp('undef', 'undef', 'undef', 'ChartStyle', 'bar', 'Order', 'ASC|ASC|ASC|ASC', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 467 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 467 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 419 HTML::Mason::Request::exec('RT::Interface::Web::Request=HASH(0xc516650)') called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 168 HTML::Mason::Request::ApacheHandler::exec('RT::Interface::Web::Request=HASH(0xc516650)') called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 825 HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0xb7074ac)', 'Apache2::RequestRec=SCALAR(0xc511464)') called at /usr/local/rt38/bin/webmux.pl line 148 eval {...} called at /usr/local/rt38/bin/webmux.pl line 148 RT::Mason::handler('Apache2::RequestRec=SCALAR(0xc511464)') called at -e line 0 eval {...} called at -e line 0 (/usr/local/lib/perl5/5.8.8/Carp.pm:272) [Tue Aug 19 08:50:13 2008] [debug]: RT::Date used Time::ParseDate to make '2008-08-01' 1217541600 (/usr/local/rt38/bin/../lib/RT/Date.pm:209) [Tue Aug 19 08:50:13 2008] [warning]: DBD::Pg::st execute failed: ERROR: column "users_5.name" must appear in the GROUP BY clause or be used in an aggregate function at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 505. (/usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm:505) [Tue Aug 19 08:50:13 2008] [warning]: RT::Handle=HASH(0xb75825c) couldn't execute the query 'SELECT DISTINCT COUNT(main.id) AS id, Users_5.Name AS col1 FROM Tickets main JOIN Groups Groups_1 ON ( Groups_1.Domain = 'RT::Ticket-Role' ) AND ( Groups_1.Type = 'Requestor' ) AND ( Groups_1.Instance = main.id ) LEFT JOIN CachedGroupMembers CachedGroupMembers_2 ON ( CachedGroupMembers_2.GroupId != CachedGroupMembers_2.MemberId ) AND ( CachedGroupMembers_2.GroupId = Groups_1.id ) LEFT JOIN CachedGroupMembers CachedGroupMembers_4 ON ( CachedGroupMembers_4.GroupId != CachedGroupMembers_4.MemberId ) AND ( CachedGroupMembers_4.GroupId = Groups_1.id ) LEFT JOIN Users Users_3 ON ( Users_3.id = CachedGroupMembers_2.MemberId ) LEFT JOIN Users Users_5 ON ( Users_5.id = CachedGroupMembers_4.MemberId ) WHERE (main.Status != 'deleted') AND (main.Status != 'rejected' AND main.Created > '2008-07-31 22:00:00') AND (main.Type = 'ticket') AND (main.EffectiveId = main.id) GROUP BY Users_3.Name ' at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 518 DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0xb75825c)', 'SELECT DISTINCT COUNT(main.id) AS id, Users_5.Name AS col1 FR...') called at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder.pm line 238 DBIx::SearchBuilder::_DoSearch('RT::Report::Tickets=HASH(0xc585110)') called at /usr/local/rt38/bin/../lib/RT/Report/Tickets.pm line 164 RT::Report::Tickets::_DoSearch('RT::Report::Tickets=HASH(0xc585110)') called at /usr/local/lib/perl5/site_perl/5.8.8/DBIx/SearchBuilder.pm line 498 DBIx::SearchBuilder::Next('RT::Report::Tickets=HASH(0xc585110)') called at /usr/local/rt38/bin/../lib/RT/Report/Tickets.pm line 228 RT::Report::Tickets::Next('RT::Report::Tickets=HASH(0xc585110)') called at /usr/local/rt38/share/html/Search/Chart line 126 HTML::Mason::Commands::__ANON__('Rows', 50, 'SecondaryGroupBy', '', 'PrimaryGroupBy', 'Requestor', 'Format', '\' <b><a href="__WebPath__/Ticket/Display.html?id=__id__">_...', 'Order', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xc515dec)', 'Rows', 50, 'SecondaryGroupBy', '', 'PrimaryGroupBy', 'Requestor', 'Format', '\' <b><a href="__WebPath__/Ticket/Display.html?id=__id__">_...', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1278 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1268 HTML::Mason::Request::comp('undef', 'undef', 'undef', 'Rows', 50, 'SecondaryGroupBy', '', 'PrimaryGroupBy', 'Requestor', ...) called at /usr/local/rt38/share/html/autohandler line 308 HTML::Mason::Commands::__ANON__('Order', 'ASC|ASC|ASC|ASC', 'ChartStyle', 'bar', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, 'SecondaryGroupBy', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbc32400)', 'Order', 'ASC|ASC|ASC|ASC', 'ChartStyle', 'bar', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', 'Rows', 50, ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1273 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1268 HTML::Mason::Request::comp('undef', 'undef', 'undef', 'Order', 'ASC|ASC|ASC|ASC', 'ChartStyle', 'bar', 'Query', 'Status != \'rejected\' AND Created > \'2008-08-01\'', ...) called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 467 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 467 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 419 HTML::Mason::Request::exec('RT::Interface::Web::Request=HASH(0xc2bc1a8)') called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 168 HTML::Mason::Request::ApacheHandler::exec('RT::Interface::Web::Request=HASH(0xc2bc1a8)') called at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 825 HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0xb7074ac)', 'Apache2::RequestRec=SCALAR(0xc518440)') called at /usr/local/rt38/bin/webmux.pl line 148 eval {...} called at /usr/local/rt38/bin/webmux.pl line 148 RT::Mason::handler('Apache2::RequestRec=SCALAR(0xc518440)') called at -e line 0 eval {...} called at -e line 0 (/usr/local/lib/perl5/5.8.8/Carp.pm:272) So, this is: FreeBSD 7.0-RELEASE-p2 apache-2.2.9 mod_perl2-2.0.4,3 and: Loaded perl modules Perl v5.8.8 under freebsd Apache2::Const v2.000004; Apache2::Log v2.000004; Apache2::Module v2.000004; Apache2::RequestIO v2.000004; Apache2::RequestRec v2.000004; Apache2::RequestUtil v2.000004; Apache2::Response v2.000004; Apache2::ServerUtil v2.000004; Apache2::Status v4.00; Apache::DBI v1.06; Apache::Session v1.86; Apache::Session::Generate::MD5 v2.1; Apache::Session::Lock::Null v1.01; Apache::Session::Postgres v1.01; Apache::Session::Serialize::Base64 v1.01; Apache::Session::Store::DBI v1.02; Apache::Session::Store::Postgres v1.03; APR v0.009000; APR::Error v0.009000; APR::Pool v0.009000; APR::Table v0.009000; APR::Util v0.009000; AutoLoader v5.60; base v2.07; bytes v1.02; Cache::Simple::TimedExpiry v0.27; Calendar::Simple v44; capitalization v0.03; Carp v1.04; CGI v3.38; CGI::Cookie v1.29; CGI::Util v1.5_01; Class::Container v0.12; Class::Data::Inheritable v0.08; Class::Inspector v1.23; Class::ISA v0.33; Class::ReturnValue v0.55; Clone v0.28; constant v1.05; CSS::Squish v0.07; Cwd v3.2701; Data::Dumper v2.121_08; Date::Format v2.22; Date::Parse v2.27; DateTime v0.4302; DateTime::Locale v0.4001; DateTime::TimeZone v0.7701; DateTime::TimeZone::Floating v0.01; DateTime::TimeZone::Local v0.01; DateTime::TimeZone::OffsetOnly v0.02; DateTime::TimeZone::UTC v0.01; DBD::Pg v2.9.0; DBD::Sponge v12.010002; DBI v1.604; DBIx::SearchBuilder v1.54; DBIx::SearchBuilder::Union v0; DBIx::SearchBuilder::Unique v0.01; Devel::StackTrace v1.1902; Devel::StackTraceFrame v1.1902; Devel::Symdump v2.08; Digest::base v1.00; Digest::MD5 v2.36; DynaLoader v1.05; Email::Address v1.889; Encode v2.26; Encode::Alias v2.10; Encode::Config v2.05; Encode::Encoding v2.05; Errno v1.0901; Exception::Class v1.24; Exception::Class::Base v1.2; Exporter v5.58; Exporter::Heavy v5.58; Fcntl v1.05; File::Basename v2.74; File::Glob v1.05; File::Path v1.08; File::ShareDir v1.00; File::Spec v3.2701; File::Spec::Unix v3.2701; File::Temp v0.20; FileHandle v2.01; GD v2.39; GD::Graph v1.44_01; GD::Graph::axestype v1.46; GD::Graph::bars v1.27; GD::Graph::colour v1.10; GD::Graph::Data v1.22; GD::Graph::Error v1.8; GD::Graph::utils v1.7; GD::Image v2.27; GD::Text v0.86; GD::Text::Align v1.18; GraphViz v2.03; HTML::Element v3.23; HTML::Entities v1.35; HTML::Formatter v2.04; HTML::FormatText v2.04; HTML::Mason v1.39; HTML::Mason::ApacheHandler v1.69; HTML::Mason::Exception v1.1; HTML::Mason::Exception::Abort v1.1; HTML::Mason::Exception::Compilation v1.1; HTML::Mason::Exception::Compilation::IncompatibleCompiler v1.1; HTML::Mason::Exception::Compiler v1.1; HTML::Mason::Exception::Decline v1.1; HTML::Mason::Exception::Params v1.1; HTML::Mason::Exception::Syntax v1.1; HTML::Mason::Exception::System v1.1; HTML::Mason::Exception::TopLevelNotFound v1.1; HTML::Mason::Exception::VirtualMethod v1.1; HTML::Mason::Exceptions v1.43; HTML::Parser v3.56; HTML::Scrubber v0.08; HTML::Tagset v3.20; HTML::TreeBuilder v3.23; I18N::LangTags v0.35; I18N::LangTags::Detect v1.03; integer v1.00; IO v1.23; IO::File v1.14; IO::Handle v1.27; IO::InnerFile v2.110; IO::Lines v2.110; IO::ScalarArray v2.110; IO::Seekable v1.1; IO::WrapTie v2.110; IPC::Open2 v1.02; IPC::Open3 v1.02; IPC::Run v0.80; List::MoreUtils v0.22; List::Util v1.19; Locale::Maketext v1.13; Locale::Maketext::Fuzzy v0.10; Locale::Maketext::Guts v1.13; Locale::Maketext::GutsLoader v1.13; Locale::Maketext::Lexicon v0.66; Locale::Maketext::Lexicon::Gettext v0.16; Log::Dispatch v2.21; Log::Dispatch::Base v1.09; Log::Dispatch::File v1.22; Log::Dispatch::Output v1.26; Log::Dispatch::Screen v1.17; Log::Dispatch::Syslog v1.18; Mail::Address v2.02; Mail::Field v2.02; Mail::Field::AddrList v2.02; Mail::Field::Date v2.02; Mail::Field::Generic v2.02; Mail::Header v2.02; Mail::Internet v2.02; Mail::Mailer v2.02; Mail::Util v2.02; MIME::Base64 v3.07; MIME::Body v5.427; MIME::Decoder v5.427; MIME::Decoder::NBit v5.427; MIME::Entity v5.427; MIME::Field::ContDisp v5.427; MIME::Field::ConTraEnc v5.427; MIME::Field::ContType v5.427; MIME::Field::ParamVal v5.427; MIME::Head v5.427; MIME::Parser v5.427; MIME::QuotedPrint v3.07; MIME::Tools v5.427; MIME::Words v5.427; mod_perl v2.000004; mod_perl2 v2.000004; ModPerl::Const v2.000004; Module::Versions::Report v1.05; overload v1.04; Params::Util v0.33; Params::Validate v0.89; PerlIO v1.04; PerlIO::scalar v0.04; POSIX v1.09; re v0.05; Regexp::Common v2.122; Regexp::Common::delimited v2.106; Regexp::Common::URI v2.110; Regexp::Common::URI::fax v2.102; Regexp::Common::URI::file v2.102; Regexp::Common::URI::ftp v2.103; Regexp::Common::URI::gopher v2.102; Regexp::Common::URI::http v2.103; Regexp::Common::URI::news v2.102; Regexp::Common::URI::pop v2.102; Regexp::Common::URI::prospero v2.102; Regexp::Common::URI::RFC1035 v2.102; Regexp::Common::URI::RFC1738 v2.106; Regexp::Common::URI::RFC1808 v2.102; Regexp::Common::URI::RFC2384 v2.104; Regexp::Common::URI::RFC2396 v2.102; Regexp::Common::URI::RFC2806 v2.102; Regexp::Common::URI::tel v2.102; Regexp::Common::URI::telnet v2.102; Regexp::Common::URI::tv v2.102; Regexp::Common::URI::wais v2.102; RT v3.8.1; RT::Interface::Email v2; RT::Interface::Web::Request v0.30; Scalar::Util v1.19; SelectSaver v1.01; Socket v1.78; Storable v2.18; strict v1.03; Symbol v1.06; Sys::Syslog v0.13; Text::Autoformat v1.14.0; Text::Quoted v2.05; Text::Reform v1.12.2; Text::Tabs v2005.0824; Text::Template v1.45; Text::Wrapper v1.02; Time::HiRes v1.9715; Time::JulianDay v2003.1125; Time::Local v1.18; Time::ParseDate v2006.0814; Time::Timezone v2006.0814; Time::Zone v2.22; Tree::Simple v1.18; UNIVERSAL v1.01; UNIVERSAL::require v0.11; URI v1.37; URI::Escape v3.29; URI::file v4.20; utf8 v1.06; vars v1.01; version v0.76; version::vxs v0.76; Want v0.18; warnings v1.05; warnings::register v1.01; XSLoader v0.06; Any ideas? Rainer _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com