[rt-users] CommandbyMail - CustomFields - Can't get $queue->TicketCustomFields;

anthony acquanita acqantreader at gmail.com
Thu Jul 22 23:50:31 EDT 2010


So I never enter this while loop.  If I run a script outside of RT it works

my $custom_fields = $queue->TicketCustomFields;
        while ( my $cf = $custom_fields->Next ) {
            $RT::Logger->error( "HORRAY" );
            my %tmp = _ParseAdditiveCommand( \%cmds, 0, "CustomField{".
$cf->Name ."}" );
            next unless keys %tmp;
            $create_args{ 'CustomField-' . $cf->id } = [
_CompileAdditiveForCreate(%tmp) ];
        }


###############
perl script that works using same user
###############

use RT;
use RT::Queues;
use RT::Queue;
use RT::Interface::CLI qw(CleanEnv GetCurrentUser);
use RT::Tickets;
use Data::Dumper;

RT::LoadConfig();
RT::Init();
my $current_user = GetCurrentUser('user' );

#print Dumper $current_user;
my $queue = new RT::Queue($current_user);
my $queue_id = 15;
$queue->Load($queue_id);
my $custom_fields = $queue->TicketCustomFields;
#print Dumper $custom_fields;

while ( my $cf = $custom_fields->Next ) {
            print Dumper $cf;
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100722/ead7ac3e/attachment.htm>


More information about the rt-users mailing list