[rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets

Landon Stewart lstewart at iweb.com
Tue Mar 10 03:15:54 EDT 2015


Hello,

It seems that one cannot load the values of a CF with $Ticket{'TOP'}->CustomFieldValues($fieldname).  The result is an empty variable.  I've confirmed that the foreach works for each of the $cfname in the @cflist since I get log entries for them but $cfvs->Next doesn't produce a value (nothing is logged).

===Create-Ticket: Investigation
{
  my @cflist = [ 'Customfield1', 'Customfield2', 'etc'];
  our @CFTEXT;
  foreach my $cfname (@cflist) {
    RT::Logger->info($cfname);
    my $cfvs = $Tickets{"TOP"}->CustomFieldValues($cfname);
    while (my $cfv = $cfvs->Next) {
      RT::Logger->info($cfname.": ".$cfv->Content);
      push @CFTEXT, "CF-".$cfname.": ".$cfv->Content;
    }
  }
}
Queue: Investigations
Parents: TOP
Status: open
{ join("\n", @CFTEXT) }
Content-Type: text/html
Content:<pre>{$Tickets{"TOP"}->Transactions->First->Content}</pre>
ENDOFCONTENT

LOGS from the foreach() (but not from the while()):
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer ID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Language (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Name (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Email (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Email Tech (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Type (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Name (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device O/S (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Control Panel (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Country (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Groups (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Ticket Priority (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Managed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer SystemDB (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Price (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Type (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Facility (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Bits (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Addresses (template:8)



I've also tried loading the CF using $Tickets{"TOP"}->LoadCustomFieldByIdentifier($cfname) but this does not work either.

Basically I'm waning to copy a list of CFs from $Tickets{'TOP'} to the newly created one.

Thank you.

Landon Stewart : lstewart at iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150310/1fffcb4e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150310/1fffcb4e/attachment.sig>


More information about the rt-users mailing list