[rt-users] Custom Field check on ticket creation error in custom condition - help please

Kevin Gagel gagel at cnc.bc.ca
Tue Jul 14 12:11:47 EDT 2009

I'm trying to run the following code in my custom condition
#Don't bother running unless the transaction is a create.
return 0 unless $self->TransactionObj->Type eq "Create";

#Don't bother running unless the custom field Urgency is URGENT.
my $CustomFields = $ticket->QueueObj->TicketCustomFields();
while (my $CustomField = $CustomFields->Next()) {
   my $nam = $CustomField->Name;
   if $ticket->FirstCustomFieldValue($nam) eq "URGENT" {
    return 1
    return 0

But I get this error logged:
Scrip 12 IsApplicable failed: Global symbol "$ticket" requires explicit package name at (eval 1692) line 5.

I'm obviously not getting the difference between writing a scrip and writing perl code. I'm terribly weak on both. Can someone show me what I'm doing wrong please...

Kevin W. Gagel
Network Administrator
Local 5448
My blog:
My shared files:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090714/9c4de624/attachment.htm>

More information about the rt-users mailing list