[rt-users] How set a default value on Custom Field when Change Owner

mauricio.leite at planalto.gov.br mauricio.leite at planalto.gov.br
Tue Mar 1 08:04:13 EST 2011


I made  a scrip to set a value on CF when changing owner, but is not
working.
Does somebody can help me.
My code bellow:

use RT::Ticket;
use RT::CustomField;
my $Ticket = $self->TicketObj;
my $CFName = 'Tipo de Defacement';
my $QueueObj = $Ticket->QueueObj;
my $CFObj = RT::CustomField->new( $QueueObj->$self->CurrentUser );
$CFObj->LoadByNameAndQueue( Name => $CFName, Queue => $QueueObj->id );
$Ticket->AddCustomFieldValue(   Field => $CFObj->id,
                                         Value => "Desfiguracao de Sitio",
                                         RecordTransaction => 1);
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110301/e1bde313/attachment.htm>


More information about the rt-users mailing list