[rt-users] Adding a CustomField to a ticket?

Rick Russell rickr at rice.edu
Tue Oct 18 20:59:23 EDT 2005



Howard Jones wrote:

>   my $cf = $tick->QueueObj->CustomField('OutageSource');

I think this is where you're going south. Custom Fields are independent
objects, not actually part of the Queue object.

I got this out of the Wiki (I've replaced some of the variable names to
match your code):

my $QueueObj = $self->TicketObj->QueueObj;
my $cf = RT::CustomField->new( $QueueObj->CurrentUser );

$cf->LoadByNameAndQueue( Name => 'OutageSource', Queue => 0 );
# for global CFs: Queue => 0
# for queue CFs: Queue => QueueObj->id

my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue(
                        Field => $cf->id,
                        Value => $requestor,
            RecordTransaction => 1 );

-- 
For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
--
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267  Fax: 713.348.6099
--
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98  F5E5 5C8C 56CA C7CB B669
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20051018/21fe12c8/attachment.sig>


More information about the rt-users mailing list