[rt-users] getting ticket's custom field values from within scrip?!

hubert lubaczewski hubert.lubaczewski at eo.pl
Mon Oct 4 11:59:56 EDT 2004

i'm getting kind of desperate.
i tried nearly everything, yet i can't succed.
i'm using rt 3.0.6, and my final scrip action looks like:

-- action
open(OUT, ">", "/tmp/scrip.test");
<snipped irrelevant lines>
my @a = $self->TicketObj->FirstCustomFieldValue('worktime-a');
require Data::Dumper;
print OUT "7: " . Data::Dumper::Dumper(\@a);

my $cfx = new RT::CustomField( $self->TransactionObj->CreatorObj );
print OUT "8: $cfx\n";
($id,$msg) = $cf->LoadByNameAndQueue ('Name'=>'worktime-a', 'Queue' => $self->TicketObj->QueueObj->Id);
print OUT "9: $id | $msg\n";
if (! $id) {
	($id,$msg) = $cf->LoadByNameAndQueue ('Name'=>'worktime-a', 'Queue' => 0);
	print OUT "9a: $id | $msg\n";
unless ($id) {
	close OUT;
	return 1;
my $x = $self->TicketObj->FirstCustomFieldValue($cfx->id);
require Data::Dumper;
print OUT "10: [$x]\n";
my $CustomFieldValues=$self->TicketObj->CustomFieldValues('worktime-a');
my @x;
while (my $CustomFieldValue = $CustomFieldValues->Next) {
	push @x, $CustomFieldValue->Content;
print OUT "11: [".join(", ", @x).".\n";
close OUT;
return 1;

-- action

basically, despite the fact that i have set worktime-a for this ticket
to 123, all i got is undef.
can anybody of you point me to *working* way of getting ticket's custom
field value?

best regards


hubert lubaczewski
Network Operations Center
Eo Networks Sp. z o.o.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20041004/c21cab09/attachment.sig>

More information about the rt-users mailing list