[Rt-devel] On Create Merge Scrip

Brian Del Shasta briandelshasta at gmail.com
Mon Nov 9 15:07:37 EST 2009


Hello,
I hoping someone can help me understand why a scrip I'm trying to create is
not working correctly.

Description: MergeBasedOnContent
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom condition: <blank>
Custom action preparation code:

my $AttachObj = $self->TransactionObj->Attachments->First;
my $content = $AttachObj->Content;
if ( $content =~ s/^\Qmerge:\E\s*(\S+)\s*$//im ) {
  $self->TicketObj->MergeInto( $1 );
}

Custom action cleanup code: <blank>

The goal here is to search any new tickets for a string 'merge:' followed by
a number, and then merge the new ticket into that number.  This works fine
for condition: On Correspond, but I am unable to get it to work on create.
It seems like its not finding the attachment.
Any ideas?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20091109/f43deabc/attachment.htm 


More information about the Rt-devel mailing list