[rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets
Landon Stewart
lstewart at iweb.com
Tue Mar 10 13:48:48 EDT 2015
Hello RT-Users,
Nevermind! :-)
I'm doing a chain of RT::Action::CreateTickets and it turns out my problem was that the custom fields were not being set before the Investigation ticket creation and therefor the CF's had no values. Once the issue with that was resolved it all started working perfectly.
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
> On Mar 10, 2015, at 12:15 AM, Landon Stewart <lstewart at iweb.com> wrote:
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150310/ba720db6/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/ba720db6/attachment.sig>
More information about the rt-users
mailing list