More info:
Here is what I have so far (thanks to AJ for helping):
my $Ticket = $self->TicketObj;
my $members = $Ticket->MemberOf;
my $link = $members->Next;
$RT::Logger->debug(“Calling BaseObj”);
my $parent = $link->BaseObj;
$RT::Logger->debug(“BaseObj called”);
my $value = $parent->FirstCustomFieldValue(“OAReqNum”);
$Ticket->AddCustomFieldValue(Field => 1, Value => $value);
I get the error “Can’t call method “BaseObj” on an undefined value”
I know this ticket has a parent. That is, unless the link
to the parent is created after the “On Create” scrip is run.
I have also found that the parent IS found if I change
the condition to “On Transaction”. So I guess the parent
link is created after the “On Create” scrip is run?
Any ideas?
Also, what is the difference between Stage: TransactionCreate
and Stage: TransactionBatch?
-Todd (Running RT 3.0.8)On Mon, Jan 26, 2004 at 10:50:03AM -0500, Todd Chapman wrote:
I’m try to create a user defined scrip. What I want to do
is when a ticket is created, if it is a MemberOf (child of)
another ticket, and the partent ticket has a certain custom
field set, set the same value in the new ticket.
In other words, I am trying to propogate a custom field
value to the children of a ticket, at ticket creation time.
Here is my custome action preparation code so far:
my $Ticket = $self->TicketObj;
my $LinkObj = $Ticket->MemberOf;
my $Link = $LinkObj->Next;
Is is the 3rd line which triggers this error:
Jan 26 07:20:13 slah001 RT: RT::Scrip=HASH(0x9b52884): Couldn’t prepare User Defined (/opt/rt3/lib/RT/Scrip_Overlay.pm:346)
Can anyone spot the problem?
Thanks.
-Todd
rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives
Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm