[Rt-devel] RE: Transfer custom field value in ticket
Juan Ramón Alfageme Mata
JRamon.Alfageme at alhambra-eidos.com
Wed Mar 30 02:57:45 EST 2005
I tried some more combinations without success.
[Wed Mar 30 07:03:17 2005] [error]: Scrip 69 Commit failed: Can't call method "BaseObj" on an undefined value at (eval 817) line 4.
Stack:
[(eval 817):4]
[/opt/rt3/lib/RT/ScripAction_Overlay.pm:228]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:506]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:191]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:168]
[/opt/rt3/lib/RT/Record.pm:1373]
[/opt/rt3/lib/RT/Ticket_Overlay.pm:720]
[/opt/rt3/lib/RT/Interface/Web.pm:386]
[/opt/rt3/share/html/RTIR/Incident/Display.html:273]
[/opt/rt3/share/html/RTIR/Incident/Create.html:231]
[/opt/rt3/share/html/RTIR/Create.html:351]
[/opt/rt3/share/html/RTIR/autohandler:2]
[/opt/rt3/share/html/autohandler:215]
(/opt/rt3/lib/RT/Action/UserDefined.pm:81)
[Wed Mar 30 07:03:17 2005] [info]: Ticket 691 created in queue 'Incidents' by user (/opt/rt3/lib/RT/Ticket_Overlay.pm:730)
Looking at commit code, problem must be in the second line, I am unable to get the reference ticket, in the log problem is always the same there is no reference ticket:
my $CFName = 'CFName';
my $Reference = $self->TicketObj->ReferredToBy->Next; --> Problem must be here.
my $SourceTicket = $Reference->BaseObj;
$RT::Logger->debug ("source ticket subject: " . $SourceTicket->Subject);
my $CF1Values = $SourceTicket->CustomFieldValues($CFName);
$RT::Logger->debug ("Values for custom field $CFName: " . $CF1Values);
while (my $CurrValue = $CF1Values->Next()) {
my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue (Field =>
$CFName, Value => $CurrValue->Content);
$RT::Logger->debug ("Adding a value to custom field: $st - $msg")
}
return 1;
Thanks for your help.
Juan Ramón Alfageme Mata
+34 91 787 23 00 alhambra-eidos.com
More information about the Rt-devel
mailing list