[rt-users] Trouble with scrip to set status based on email subject

Dave Pascoe davekm3t at gmail.com
Tue Aug 30 11:17:54 EDT 2011


Forgot to mention - running 4.0.2.

-Dave

On Tue, Aug 30, 2011 at 10:53 AM, Dave Pascoe <davekm3t at gmail.com> wrote:

> Trying to set up this Scrip to set Resolved status based on email subject.
>  It is auto-closing all tickets.
> Any ideas?  I have to be missing something basic.  I already tested the
> regex match separately.  I also thought I had the logic reversed but tested
> it both ways (!~ and =~).
>
> TIA,
> Dave
>
> Description: Auto Close Google Checkout emails
> Condition: On Create
> Action: User Defined
> Template: Global Template: Blank
> Stage: TransactionCreate
>
> Custom condition:
> my $match = "Order [0-9][0-9]+ has been cancelled by Google";
> my $t_subject = $self->TicketObj->Subject;
> if ( $t_subject =~ /$match/i ) {
> return 1;
> }
> else {
> return 0;
> }
>
> Custom action preparation code:
>
> return 1;
>
> Custom action cleanup code:
>
> $self->TicketObj->SetStatus( "resolved" );
> return 1;
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110830/c34b5b23/attachment.htm>


More information about the rt-users mailing list