[rt-users] Query problem(tickets req by grp members), RT just hangs

Ruslan Zakirov ruslan.zakirov at gmail.com
Wed Oct 19 13:40:16 EDT 2005


On 10/19/05, Weqaar Janjua <weqaar at yahoo.com> wrote:
> I have the following lines of code in
> /Elements/Grprequests the purpose of which is to
> display tickets requested by user's group members(user
> can be a member of more than one group), when the page
> is loaded RT just hangs(does not die), as if its
> trying to run the query:
You should try to figure out where it hangs. Does it spin in DB or in RT code?
What is in the RT log file? Code looks fine, at least I don't see any mistakes.


PS: You forgot to specify software versions.

>
>
> <%init>
> my $Groups = RT::Groups->new($session{'CurrentUser'});
> $Groups->LimitToUserDefinedGroups();
> $Groups->WithMember(PrincipalId =>
> $session{'CurrentUser'}->Id);
>
> my $rows = 10;
>
> my $Queues = RT::Queues->new($session{'CurrentUser'});
> $Queues->UnLimit();
>
> my $QueuesListing = '';
>
> my @ids;
> my $Group;
>
> while ( $Group = $Groups->Next ) {
>                 push @ids, $Group->Id;
> }
>
> while (my $queue = $Queues->Next) {
>    next unless
> ($queue->CurrentUserHasRight('ShowTicket'));
>    if ($QueuesListing ne '') {
>      $QueuesListing .= " OR Queue = ";
>    } else {
>      $QueuesListing = "Queue = ";
>    }
>    $QueuesListing .= "'".$queue->Name."'";
> }
>
>
> my $Query = "
>    Requestor != '".$session{'CurrentUser'}->Id."'
>    AND ( Status = 'new' OR Status = 'open' OR Status =
> 'stalled' )
>    AND ( RequestorGroup = '$ids[0]' OR RequestorGroup
> = '$ids[1]' )
>    AND ( " . $QueuesListing . " )
>    ";
>
> my $QueryString = '?' .
> $m->comp('/Elements/QueryString',
>              Query => $Query,
>              Order => 'DESC',
>              OrderBy => 'Priority') if ($Query);
>
> </%init>
>

--
Best regards, Ruslan.



More information about the rt-users mailing list