[Rt-devel] Ticket Ownership Enumeration Problem

Jeff Albert jralbert at uvic.ca
Mon Jan 10 23:12:30 EST 2005


Hello all,
I'm a beginner at hacking RT, and at Perl, so please forgive me if this
turns out to be a foolish question, but:

I'm trying to create a scrip which will, upon ticket creation, evaluate a
custom field value to determine which group of our team should address the
issue, then determine who among them has the fewest open tickets, and
finally choose a random member of that subset to be assigned ownership of
the ticket. Presently I'm stuck at trying to determine how many tickets a
given user has open. It seems to me that this should be fairly trivial, but
I'm having no luck. Here's what I'm doing currently:


#...$org is gotten from custom field...

if ($org eq 'HUMA') {
	my %HSD = ('jralbert' => 0, 'jafraser'=> 0, 'mhelfric' => 0);
	my $CurrentUser = $RT::SystemUser;
	my $OpenTickets;
	$OpenTickets = new RT::Tickets ($CurrentUser);
	while ($id, $score) = each(%HSD)) {
		$MyTickets->UnLimit();
		$MyTickets->LimitOwner( VALUE => "jralbert" );
		$MyTickets->LimitStatus( VALUE=> "open" );
		$HSD{$id} = $MyTickets->Count();
	}
}

It looks as if the scrip dies on trying the LimitOwner method, and gets no
further. What am I doing wrong? I thank you in advance for any help you may
provide.

Cheers,
Jeff Albert

Departmental Computing Support Team
University of Victoria
British Columbia, Canada
jralbert at uvic dot ca




More information about the Rt-devel mailing list