So I never enter this while loop. If I run a script outside of RT it works<br><br>my $custom_fields = $queue->TicketCustomFields;<br> while ( my $cf = $custom_fields->Next ) {<br> $RT::Logger->error( "HORRAY" );<br>
my %tmp = _ParseAdditiveCommand( \%cmds, 0, "CustomField{". $cf->Name ."}" );<br> next unless keys %tmp;<br> $create_args{ 'CustomField-' . $cf->id } = [ _CompileAdditiveForCreate(%tmp) ];<br>
}<br><br><br>###############<br>perl script that works using same user<br>###############<br><br>use RT;<br>use RT::Queues;<br>use RT::Queue;<br>use RT::Interface::CLI qw(CleanEnv GetCurrentUser);<br>use RT::Tickets;<br>
use Data::Dumper;<br><br>RT::LoadConfig();<br>RT::Init();<br>my $current_user = GetCurrentUser('user' );<br><br>#print Dumper $current_user;<br>my $queue = new RT::Queue($current_user);<br>my $queue_id = 15;<br>$queue->Load($queue_id);<br>
my $custom_fields = $queue->TicketCustomFields;<br>#print Dumper $custom_fields;<br><br>while ( my $cf = $custom_fields->Next ) {<br> print Dumper $cf;<br> }<br>