Pierre:
my $queues = new RT::Queues(RT::SystemUser);
is fine but you need to limit
Just add
$queues->UnLimit;
my $queues = new RT::Queues(RT::SystemUser);
$queues->UnLimit;
foreach my $queue ($queues->Next) {
}
By the way , a comment on your next bit, I am just curious why you build a hash
, then you go through it looking for a match??
Why don't you do
foreach my $queue ($queues->Next) {
my $blah = $queue->FirstCustomFieldValue('MailDomain') ;
If ($self->TicketObj->RequestorAddresses =~ /^.*?${$blah}/) {
$self->TicketObj->SetQueue($queue->id);
return;
}
}
Roy
From: [email protected]
[mailto:[email protected]] On Behalf Of Pierre Buhas
Sent: 20 January 2011 09:14
To: [email protected]
Subject: Re: [rt-users] Email Queue Routing
This is my loop on the queues which is not working..
my $queues = new RT::Queues(RT::SystemUser);
foreach my $queue ($queues->Next) {
there must be some mistake above. Is the creation of my variable $queues
correct ?
I also tried the following:
my $queues = new RT::Queues(RT::SystemUser);
while ( my $queue = $queues->Next ) {
but it did not work better. So that's why I suspect this is the way I get the
list of queues which is not the way it should be..
Any idea ?
Thanks
Pierre BUHAS
+353 1 217 8422
Duolog Technologies
On 19 January 2011 21:43, Kevin Falcone
<[email protected]<mailto:[email protected]>> wrote:
On Wed, Jan 19, 2011 at 02:09:38PM +0000, Pierre Buhas wrote:
> my %domain_map = ();
> my $queues = new RT::Queues(RT::SystemUser);
> foreach my $queue ($queues->Next) {
> $domain_map { $queue->FirstCustomFieldValue('MailDomain') } = $queue->Name;
> }
That really wants to be a while ( my $queue = $queues->Next ) {
The new is really old-style but should be fine
-kevin