RT 3.6.3: Solaution to limiting display of "10 unowned tickets" in "RT at a glance"

Hi Everyone,

I was able to figure out how to limit the “10 unowned tickets” to
display tickets from queues that one has access to, as opposed to
displaying all unowned tickets. This change applies to Request Tracker
3.6.3, but probably will work in older versions of 3.6. To accomplish
this, you have to modify /opt/rt3/Elements/ShowSearch, as follows:

114c114,140

< my $QueryString = ‘?’ . $m->comp( ‘/Elements/QueryString’, %$SearchArg
);

my $QueryString;

if ($Name eq “Unowned Tickets”) {

# The next section of code will limit unowned tickets to only be
# those that are in a queue that a user can own tickets in
my $q = new RT::Queues($session{'CurrentUser'});
$q->UnLimit;
my @queues;
while (my $queue = $q->Next) {
      if ($queue->CurrentUserHasRight( 'OwnTicket' )) {
            push( @queues, "Queue = \'".$queue->Name."\'" );
      }
}
my $unowned_queues = " AND "."(".join( " OR ",@queues ).")";
my $SavedQuery = $SearchArg->{'Query'};
$SearchArg->{'Query'} = $SavedQuery.$unowned_queues;
# End code section
$QueryString = '?' . $m->comp( '/Elements/QueryString',

%$SearchArg );

} else {

$QueryString = '?' . $m->comp( '/Elements/QueryString',

%$SearchArg );

}

Once the changes are made, you need to stop your web server, type: rm
-rf /opt/rt3/var/mason_data/obj, and restart your web server.

I hope everyone finds this information useful.

Nick

Nick Metrowsky

Consulting System Administrator

303-684-4785 Office

303-684-4100 Fax

nmetrowsky@digitalglobe.com mailto:nmetrowsky@digitalglobe.com

DigitalGlobe ®, An Imaging and Information Company

http://www.digitalglobe.com http://www.digitalglobe.com