[rt-users] 10 newest unowned tickets per queue?

Schultz, Eric ESchultz at corp.untd.com
Wed Jan 25 11:02:40 EST 2006


I'm not sure that will work...  It only seems like it will give you a
query that is the last queue of all queues.

What I did was "only show me unowned tickets in queues that I can own
tickets".  Here's the code for what I did in
share/html/Elements/MyRequests (from 3.4.1, diff -c):

*** MyRequests  2005/07/05 23:47:16     1.11
--- MyRequests  2005/10/04 21:56:46     1.12
***************
*** 77,90 ****
  <%init>
  my $rows = $RT::MyRequestsLength;

! my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status =
'open')";

  my $QueryString = '?' . $m->comp('/Elements/QueryString',
              Query => $Query,
--- 77,102 ----
  <%init>
  my $rows = $RT::MyRequestsLength;

! # This 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 $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')
AND ( " . join( " OR ", @queues ) . " )";
+
  my $QueryString = '?' . $m->comp('/Elements/QueryString',
              Query => $Query,


> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com 
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf 
> Of Drew Barnes
> Sent: Wednesday, January 25, 2006 7:09 AM
> To: Florian Hochstrasser
> Cc: RT USERS
> Subject: Re: [rt-users] 10 newest unowned tickets per queue?
> 
> I did this in a pretty ugly, tossed-together-in-10-minutes 
> way. Works on 
> 3.2.2, may need a little tweaking for 3.4.4. I can't remember if that 
> was one of the ones I had to fix.
> 
> Feel free to clean this up or fix it. I stopped when it 
> started working 
> for me.
> http://wiki.bestpractical.com/index.cgi?TicketsPerQueue
> 
> 
> DB
> 
> Florian Hochstrasser wrote:
> >
> > Hi all
> >
> > As our setup is growing continually, we ran into a problem 
> regarding 
> > the display of the 10 newest unowned tickets on the Home 
> screen. The 
> > problem is that the overall ten newest tickets get into 
> that list. But 
> > all the tickets of queues that one has no permission to 
> don't show up.
> >
> > That means, if there are 10 new tickets in other queues 
> which I don't 
> > have permission for and the 11^th would be one in my queue, 
> the list 
> > appears to be empty, even though I have a new ticket to 
> work on. How 
> > can this be fixed so that this list is built on tickets of queues 
> > which one has access to?
> >
> > TIA, Florian



More information about the rt-users mailing list