[rt-users] customfields create

Craig Stevenson stevensc at nsuok.edu
Fri Nov 11 17:16:11 EST 2005


RT-ers:

I am attempting to write a script that will allow me to build the custom 
fields for tickets in a particular queue.  I am using the CLI rather 
than the web interface.  The table that hold this data is CUSTOMFIELDS.  
This means I want to work with RT::CustomField.

I am running into trouble with a create.  To my mind the following 
should kick back a useable ID but it does not.
------------script--------------------------
#!/usr/local/rt/perl/bin/perl -w

use strict;

use lib "/usr/local/rt/lib";
use RT::Interface::CLI qw(CleanEnv);
use RT::CustomField;

CleanEnv();
RT::LoadConfig();
RT::Init();

my$Obj = new RT::CustomField($RT::SystemUser);

my($code,$msg) = $Obj->Create(Name=>"test");
print "(code,msg) = ($code),($msg)\n";
my$id = $Obj->Id();
print "id=($id)\n";
------------output--------------------------
(code,msg) = (0),()
id=()
------------done--------------------------
Any pointers here would be very appreciated.  Thanks! Enjoy your weekend...
-- 

Craig Stevenson
|| stevensc at nsuok.edu | 918-456-5511x5955
|| Northeastern State University
|| 601 N. Grand | Tahlequah, Oklahoma 74464-2399





More information about the rt-users mailing list