[rt-users] ExtractCustomFields for Ticket values

Josh Coombs jcoombs at staff.gwi.net
Tue Sep 1 14:46:50 EDT 2015


I'm working on switching from individual per Queue custom scrips in Perl to
using ExtractCustomFields for populating ticket data on creation via
incoming email.  So far I've gotten the basics working, but I'm running
into a brick wall changing the ticket owner.

What we had as a scrip, pruned down to just setting the owner:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $Attachment = $Transaction->Attachments;
my $AttFirst = $Attachment->First;

my $NewRTOwner = $AttFirst->GetHeader('X-NEW-RT-OWNER');

$Ticket->SetOwner($NewRTOwner);

With ExtractCustomFields I've setup the standard scrip with the following
template:

|X-NEW-RT-OWNER|.*|$RT::Ticket->SetOwner($value)|

With debug logging lit, the post command is failing saying method SetOwner
can't be called on an undefined value.  I can see that $value is getting
correct set from the debug leading up to that failure, so I suspect this is
a scope error on my part?

Any guidance would be greatly appreciated.

Josh C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150901/045a8859/attachment.html>


More information about the rt-users mailing list