« Return to Thread: On Create Merge Scrip

On Create Merge Scrip

by Brian Del Shasta :: Rate this Message:

Reply to Author | View in Thread

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
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

 « Return to Thread: On Create Merge Scrip