[rt-users] Custom onCreate scrip

Andrew Xenides andrew at staff.esc.net.au
Mon Nov 21 20:51:32 EST 2005


Again,

The problem is the transactionobj-type = create that's causing the issue

The regex part of the scrip works fine

I want to know why its sending on all transactions, not just on the ticket
create part.


-----Original Message-----
From: Todd Chapman [mailto:todd at chaka.net] 
Sent: Tuesday, November 22, 2005 12:50 PM
To: Andrew Xenides
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq 'Create'
    and
       $self->TicketObj->RequestorAddresses =~ /send/
    and
       $self->TicketObj->RequestorAddresses !~ /dontsend/
    ) {
     return 1;
} 
0;

On Tue, Nov 22, 2005 at 12:04:12PM +1030, Andrew Xenides wrote:
> Hi,
> 
> Thanks, the reason I have it in 2 separate if statements is that the don't
> send one contains a portion of the send one, hence if its dontsend don't
> send, but if its only send, then send it. If I put send first, it will
match
> in both cases.
> 
> The problem is the transaction create part, it is sending emails even if
the
> priority is updated, or a comment is added where as I only want it when
the
> ticket is created.
> 
> -----Original Message-----
> From: Todd Chapman [mailto:todd at chaka.net] 
> Sent: Tuesday, November 22, 2005 11:57 AM
> To: Andrew Xenides
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Custom onCreate scrip
> 
> if ($self->TrasactionObj->Type eq 'Create' and
>     $self->TicketObj->RequestorAddresses =~ /send/) {
>      return 1;
> }
> 
> On Tue, Nov 22, 2005 at 09:46:30AM +1030, Andrew Xenides wrote:
> > Hi,
> > 
> > I want to do a custom condition for a scrip, which will basically be
> > OnCreate and Requestor address matches "blah" then send the auto reply.
> > 
> > At the moment I have 
> > 
> > if ($self->TrasactionObj->Type =~ 'Create'){
> >    if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
> >       return (undef);
> >    }
> >    if ($self->TicketObj->RequestorAddresses !~ /send/){
> >       return (undef);
> >    }
> > }else{
> >    return (undef)
> > }
> > return(1);
> > 
> > but that seems to be sending the auto reply on every transaction, not
just
> > when the ticket is created.
> > 
> > Im guessing im using the wrongs TransactionObj-> Type
> > 
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> > 
> > Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> > 
> > Download a free sample chapter of RT Essentials from O'Reilly Media at
> http://rtbook.bestpractical.com
> > 
> > WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> > San Francisco - Find out more at
> http://bestpractical.com/services/training.html




More information about the rt-users mailing list