[rt-users] Can I see which tickets have been replied to?
Ron Gidron
ron.gidron at shunra.com
Tue Mar 11 10:38:38 EST 2003
Bruce,
Thanks a lot man, this is great!!
It completely does the trick, I am on RT3 (2.1.85 as we speak) I'll do the
conversion and post it.
Cheers
Ron
> -----Original Message-----
> From: rt-users-admin at lists.fsck.com
> [mailto:rt-users-admin at lists.fsck.com]On Behalf Of Bruce Campbell
> Sent: Tuesday, March 11, 2003 4:20 PM
> To: RT Users
> Subject: Re: [rt-users] Can I see which tickets have been replied to?
>
>
> On Mon, 10 Mar 2003, Ron Gidron wrote:
>
> > When I log into RT I can see all of the tickets I am assigned to, the
> > problem is that I cannot distinguish between those tickets that have
> > been updated by the requestor (or anyone else but me for that matter)?
> > is there a way to see this?
>
> Apart from 'wait 6 hours, then try again' ? ;)
>
> I presume that you are referring to the main home page of an RT
> installation, where the summary of tickets is given. The obvious solution
> is to check the last item of each ticket in the summary, and see whether
> it was the requestor or an AdminCc who updated it.
>
> This sounds easy; just a trifle in fact. Right? Actually, its not as
> easy as that. Firstly, remember that RT is a database-driven application.
> Secondly, the summary page of 'top 25' stuff is already doing a lot of
> database queries to generate that information, and its doing this each
> time. Adding extra queries might well make your wait intolerable.
>
> Having said that, heres a little snippet that might do what you want, for
> RT2 (as I don't believe you specified which RT version you are using).
>
> --
> Bruce Campbell
> RIPE
> Systems/Network Engineer
> NCC
> www.ripe.net - PGP562C8B1B
> Operations/Security
>
> -- WebRT/Elements/MyTickets
> <& /Elements/TitleBoxStart, title => "25 highest priority tickets
> I own..." &>
> <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
> <TR>
> <TH ALIGN=RIGHT>#</TH>
> <TH ALIGN=LEFT>Subject</TH>
> <TH ALIGN=LEFT>Queue</TH>
> <TH ALIGN=LEFT>Status</TH>
> <TH ALIGN=LEFT> </TH>
> </TR>
> % while (my $Ticket = $MyTickets->Next) {
> % # Fill in the cache of QueueAdminCcs (remember that someone might be in
> % # multiple queues, and thus AdminCc in one might be Joe
> Average in another )
> % if( ! defined( $MyAdminCache{$Ticket->QueueObj->id} ) ){
> % my $taccs = $Ticket->QueueObj->AdminCc;
> % while( my $tmpacc = $taccs->Next() ){
> % $MyAdminCache{$Ticket->QueueObj->id}{$tmpacc->OwnerObj->id}++;
> % }
> % }
> <TR>
> <TD ALIGN=RIGHT>
> <%$Ticket->Id%>
> </TD>
> <TD>
> <A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">
> <%$Ticket->Subject || '[no subject]'%>
> </A>
> </TD>
> <TD>
> <%$Ticket->QueueObj->Name%>
> </TD>
> % # We'll use red if the requestor last did something, green if an AdminCc
> % # did something.
> % my $transactions = $Ticket->Transactions;
> % # go backwards in transactions.
> % $transactions->OrderBy( FIELD => 'id', VALUE => 'DESC' );
> % my $havelast = 0;
> % # 'yellow' for unknown status.
> % my $colour = "yellow";
> % while( ($havelast == 0 ) && ( my $trans = $transactions->Next() ) ){
> % next unless( $trans->Type() eq 'Correspond' ||
> $thistrans->Type() eq 'Create' );
> % $havelast++;
> % if( defined(
> $MyAdminCache{$Ticket->QueueObj->id}{$trans->CreatorObj->id} ) ){
> % $colour="green";
> % }else{
> % $colour="red";
> % }
> % }
> <TD BGCOLOR="<%$colour%>">
> <%$Ticket->Status%>
> </TD>
> <TD ALIGN=RIGHT>
> [<A HREF="<% $RT::WebPath
> %>/Ticket/Update.html?id=<%$Ticket->Id%>">Update</A>]
> </TD>
> </TR>
> % }
> </TABLE>
> <& /Elements/TitleBoxEnd &>
>
>
> <%INIT>
> my $MyTickets;
> $MyTickets = new RT::Tickets ($session{'CurrentUser'});
> $MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id);
> $MyTickets->LimitStatus(VALUE => "open");
> $MyTickets->LimitStatus(VALUE => "new");
> $MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
> $MyTickets->RowsPerPage(25);
>
> my %MyAdminCache = ();
>
> </%INIT>
>
>
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
>
> Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
>
More information about the rt-users
mailing list