To all,
We've been putting some custom field data in our templates for awhile,
but the tickets already exist. We are now trying to get some cf data on
an e_mail during creation and having some trouble. We’ve various
versions of "{$self->$Ticket->FirstCustomFieldValue(‘Description’)} and
also {my $Ticket_Description;
$Ticket_Description = $Ticket->FirstCustomFieldValue(‘Description’);
return $Ticket_Description;}
But to no avail. We need some help help here. Obviously, thereis
something I do not understand. Is this data just not available from the
ticket yet? I do not have the cf defined for a transaction. Thanks.
Kenn
LBNL
But to no avail. We need some help help here. Obviously, thereis
something I do not understand. Is this data just not available from the
ticket yet? I do not have the cf defined for a transaction. Thanks.
Here’s what I have in one of my conditions for new tickets. It
basically checks to see if the field is valued, and if not, the action
will set a default value:
sub IsApplicable
{
my($self) = shift;
my($CFNAME) = 'FooBarBaz';
my($q) = $self->TicketObj->QueueObj;
my($cf) = new RT::CustomField $q->CurrentUser;
$cf->LoadByNameAndQueue(Name => $CFNAME, Queue => $q->id);
$cf->LoadByNameAndQueue(Name => $CFNAME, Queue => 0) unless $cf->id;
unless ($cf->id) {
$RT::Logger->warning("Custom field '$CFNAME' isn't global or defined
for queue ‘" . $q->Name . "’");
return undef;
}
return ! $self->TicketObj->FirstCustomFieldValue($cf->id);
}
This works on 3.6.3
Regards,
joe
Joe Casadonte
joe.casadonte@oracle.com
========== ==========
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation. ==
========== ==========