Hello all,
I’m setting up a scrip to either allow or block notifying the owner of a ticket about transactions. If the owner and requestor are the same user, don’t notify, since the requestor already gets the email. If they’re different, do notify, so they both get it. My scrip looks like this:
- Condition: user defined
- Action: notify owner
- applies: globally
- enabled: yes
Custom condition code:
my $ticketRequestor = $self->TicketObj->Requestors->First->eID;
my $transactionType = $self->TransactionObj->Type;
my $validTransactionType = "Correspond";
if ($self->TicketObj->IsRequestor($ticketOwner) && $transactionType eq $validTransactionType) {
RT::Logger.info("Not emailing owner because user #" . $ticketRequestor . " is requestor and owner of ticket " . $self->TicketObj->Id);
return 0;
}
return 1;
Preparation:
return 1;
Execution:
return 1;
The error I’m seeing is on line 1. It says:
Scrip 25 IsApplicable failed: RT::User::PrincipleID unimplemented in RT::Action::UserDefined ((eval 1780) line 1)
I’ve tried OwnerObj->ID, but with the same effect on the same line. Am I missing an import? Some key step? The RT docs I’ve been reading say that OwnerObj is an instance of RT::User, and User has a PrincipleID attribute I can access. I don’t know why this code doesn’t work. I’m on RT4.4.1, in case that matters. Thanks for any ideas!