A Scrip Condition error

This short code doesnt seem to be working properly. Looking for any
pointers why its not. I’m guessing its something simple, as I am not really
a perl coder. The intentions are when a person who is neither the owner or
the requester responds to an email, the condition will fire true. While
testing this code, I dont think it ever fires true.
thanks for the help,
-Forrest

--------------------------8<-------------------------

ScripCondition: NonOwnNonReqCorrespond.pm

IsApplicable returns true if correspondence is

completed by an unknown (not owner, not requestor)

Created by Forrest Stanley

package RT::Condition::NonOwnNonReqCorrespond;
require RT::Condition::Generic;
@ISA = qw(RT::Condition::Generic);

sub IsApplicable {
my $self = shift;

 my $creator = $self->TransactionObj->CreatorObj->EmailAddress;

 if ($self->TransactionObj->Type eq 'Correspond') {
     if ($self->TicketObj->IsOwner($self->CreatorObj)) { return(undef); }
     else {
    if ($self->TicketObj->IsRequestor($self->CreatorObj)) { return(undef); }
    else { return(1);
     }
 }
 else { return(undef); }

}
1;

This short code doesnt seem to be working properly. Looking for any
pointers why its not.

You’re referring to $self->CreatorObj, when you want to be referring to
$self->TransactionObj->CreatorObj . I’m also not sure why you have
$creator about.

sub IsApplicable(){

my $self = shift;

my $retval = undef;

if( $self->TransactionObj->Type eq 'Correspond' ){
  if( ! $self->TicketObj->IsOwner( $self->TransactionObj->CreatorObj ) ){
    if( ! $self->TicketObj->IsRequestor( $self->TransactionObj->CreatorObj ) ){
	$retval = 1;
    }
  }
}

return( $retval );

}

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B             Operations/Security

http://www.dude.ru/music/gigflapping.html

At 11:32 AM 1/18/2003 +0100, Bruce Campbell wrote:

This short code doesnt seem to be working properly. Looking for any
pointers why its not.

You’re referring to $self->CreatorObj, when you want to be referring to
$self->TransactionObj->CreatorObj . I’m also not sure why you have
$creator about.

Thx for pointer, the $creator was just left over vode from trying something
else :slight_smile:
-forrest