10 newest unowned tickets per queue?

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 11th 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

This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.

Additional System Info:

RT version 3.4.4, PostgreSQL 7.4.2 on SuSE Linux Pro 9.1

Regards, FlorianFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Florian
Hochstrasser
Sent: Mittwoch, 25. Januar 2006 15:24
To: RT USERS
Subject: [rt-users] 10 newest unowned tickets per queue?

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 11th 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

This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.

This message has been checked for all known viruses by Messagelabs.

This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.

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


This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.


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

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Drew Barnes
Applications Analyst
Raymond Walters College
University of Cincinnati

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,

Alright, thanks a lot. I’ll try this today and post my results.

FlorianFrom: Schultz, Eric [mailto:ESchultz@corp.untd.com]
Sent: Mittwoch, 25. Januar 2006 17:03
To: Florian Hochstrasser
Cc: RT USERS
Subject: RE: [rt-users] 10 newest unowned tickets per queue?

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@lists.bestpractical.com
[mailto:rt-users-bounces@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

This message has been checked for all known viruses by Messagelabs.

This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.