Odd behavior of queue name translation in RT::TIcket::LimitCustomFIeld()

We’re on RT 4.0.17.

I have this code snippet in a test (Yay TDD):
my $tickets = RT::Tickets->new(GetCurrentUser());
my $queue =‘foo’
$tickets->LimitCustomField(CUSTOMFIELD => $internal_gid, OPERATOR => ‘=’,
VALUE => “i$generic_id”, QUEUE => $queue );
my $ticket = $tickets->Next;

The error from ticket->Next() is:

[Fri Feb 7 16:00:07 2014] [warning]: RT::Queue ‘{83}’ doesn’t exist,
parsed from ‘{83}.{Internal_GenericID}’

The queue in question is the queue with ID 83, and does exist. I just added
the ticket to it.

Is this a known bug in queue name handling, is it something I’ve done
wrong,
is there a known workaround?

Thanks,
Len.

lenjaffe@jaffesystems.com 614-404-4214 @lenjaffe
Information Technology Smoke Jumper, Host of Columbus Code
Jamhttp://www.meetup.com/techlifecolumbus/
www.lenjaffe.com http://www.theycomewithcheese.com
Perl Advent Planet http://www.lenjaffe.com/PerlAdventPlanet/ - Advent
Calendars: Perlish and otherwise.

my $tickets = RT::Tickets->new(GetCurrentUser());
my $queue =‘foo’
$tickets->LimitCustomField(CUSTOMFIELD => $internal_gid, OPERATOR => ‘=’,
VALUE => “i$generic_id”, QUEUE => $queue );
my $ticket = $tickets->Next;
The error from ticket->Next() is:

[Fri Feb 7 16:00:07 2014] [warning]: RT::Queue ‘{83}’ doesn’t exist,
parsed from ‘{83}.{Internal_GenericID}’

The queue in question is the queue with ID 83, and does exist. I just added
the ticket to it.

In the future, please leave on the part of the warning message which
includes that it happened in lib/RT/Tickets.pm with a line number, it
saves time.

Is this a known bug in queue name handling, is it something I’ve done

wrong, is there a known workaround?

$Tickets->LimitCustomField is used infrequently (unused in core on
Tickets).
Is there a reason you’re not using TicketSQL (what’s visible in the
Query Builder when you build a query?)

$tickets->FromSQL("CF.{Foo} = ‘i$generic_id’);
possible with a “And Queue = ‘$queue’” in there or if you don’t want
to limit on Queue, you can use CF.83.{Foo}.

The problem is that passing QUEUE to LimitCustomField is undocumented
and as a result poorly supported by the code that deciphers custom
field names. However, without digging deeper, I don’t know that
CustomFieldDecipher of LimitCustomField needs the bugfix.

-kevin

$tickets->FromSQL("CF.{Foo} = ‘i$generic_id’);
possible with a “And Queue = ‘$queue’” in there or if you don’t want
to limit on Queue, you can use CF.83.{Foo}.

FromSQL() resolved my issue.
Thanks!

The problem is that passing QUEUE to LimitCustomField is undocumented

QUEUE is documented here:
https://www.bestpractical.com/docs/rt/4.0/RT/Tickets.html#LimitCustomField

Len.

lenjaffe@jaffesystems.com 614-404-4214 @lenjaffe
Information Technology Smoke Jumper, Host of Columbus Code
Jamhttp://www.meetup.com/techlifecolumbus/
www.lenjaffe.com http://www.theycomewithcheese.com
Perl Advent Planet http://www.lenjaffe.com/PerlAdventPlanet/ - Advent
Calendars: Perlish and otherwise.