[rt-users] Customising Quicksearch to show unowned ticket counts

Ruslan Zakirov ruz at bestpractical.com
Mon Feb 27 10:34:07 EST 2012


On Mon, Feb 27, 2012 at 18:04, Tim Cutts <tjrc at sanger.ac.uk> wrote:
> Hi there,
>
> I'm in the process of doing some groundwork for migrating our [fairly customised] RT from 3.8.10 to 4.0.x, checking that our various add ons work (and if they don't, working out what we need to do to fix them).
>
> I'm currently looking at our change to the Quicksearch panel.  In 3.8.x, there was a Conditions callback, which we used to:
>
> 1) add a count of unowned tickets in each queue, something some of my users are very keen on, and
> 2) to drop the count of stalled tickets, which our users mostly don't care about.
>
> That callback has unfortunately been removed in the rewriting of this element to use life cycles and RT::Report::Tickets
>
> Of those, (2) is easy to reimplement by either editing the lifecycle configuration, or overriding the element to skip the stalled status.
>
> The first one looks much harder now, since RT::Report::Tickets appears to be simply using Group By to produce the various columns, and of course 'unowned' isn't a status as such, it requires different queries.
>
> So I've overridden the QueueSummaryByLifecycle element and just perform the extra queries separately by another RT::Report::Tickets object searching for unowned tickets in all the requested queues, unowned, and grouped by queue, and use that to add 'unowned' hash elements to the $data hash.  Is that the best approach, or have I missed something a bit more elegant?


add callback right before the following line and change $query as you need:

$report->SetupGroupings(...);

In your case callback would simple:

$$Query = "($$Query) AND Owner = 'Nobody'";

Also, components have:

$m->callback( CallbackName => 'Filter', Queues => \@queues );

You can add similar callback to filter statuses a few lines later.

So two simple patches that add one line callback calls and two callback files.


> Tim
>
>
>
> --
>  The Wellcome Trust Sanger Institute is operated by Genome Research
>  Limited, a charity registered in England with number 1021457 and a
>  company registered in England with number 2742969, whose registered
>  office is 215 Euston Road, London, NW1 2BE.
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> * Boston  March 5 & 6, 2012



-- 
Best regards, Ruslan.



More information about the rt-users mailing list