[rt-users] Setting Custom Field during Ticket creation in Perl API (4.0.2)

Srikumar Nair srikumarp at fb.com
Tue Oct 18 12:20:52 EDT 2011

retrying.. I am pretty sure there is someone in the community who can tell me what I am doing wrong ..

I am trying to set a Custom Field Value during the creation of a ticket with the following piece of code. But the value ("SN-1234") is not getting added to custom field
(BTW, I already pre created the Custom Field for the Ticket object and made it Global).

What am I doing wrong? Is SetIncludeContentForValue the correct API call?

my $cf = RT::CustomField->new($RT::SystemUser);
$cf->Load('Store Number');

unless ($cf->id) {
  $RT::Logger->error( "Couldn't load custom field " . "Store Number");

$cf->SetIncludeContentForValue ("SN-1234");

@retValues = $ticket->Create( Queue => 'My Store Queue', Subject => 'Test Ticket for Store 1234 ', CustomField => $cf);


-------- RT Training Sessions (http://bestpractical.com/services/training.html) * Washington DC, USA ˜ October 31 & November 1, 2011 * Barcelona, Spain ˜ November 28 & 29, 2011
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111018/6a0941d7/attachment.htm>

More information about the rt-users mailing list