[rt-users] New CustomFields

Todd Chapman rt at chaka.net
Fri Feb 4 16:33:15 EST 2005


Ack! Do no such thing!

Here is a script that takes 2 arguments, the name of the
CF and the name of a file that has one CF value per line
to be added to the CF.

#!/usr/bin/perl

use strict;
use Carp;

use lib ("/opt/rt3/lib", "/opt/rt3/local/lib");

use RT;
RT::LoadConfig;
RT::Init;


my $fields = RT::CustomFields->new($RT::SystemUser);
$fields->UnLimit;
$fields->Limit( FIELD => 'Name', VALUE => shift );
my $cf = $fields->First;
while (<>) {
        chomp;
        $cf->AddValue(Name => $_) or warn "Couldn't load value $_";
}

On Fri, Feb 04, 2005 at 03:03:15PM -0500, Ramon Kagan wrote:
> If you want you can do it through SQL directly (just be careful ;p)
> 
> The tables are CustomFields and CustomFieldValues.
> 
> Ramon Kagan
> York University, Computing and Network Services
> Information Security  -  Senior Information Security Analyst
> (416)736-2100 #20263
> rkagan at yorku.ca
> 
> -----------------------------------   ------------------------------------
> I have not failed.  I have just	       I don't know the secret to success,
> found 10,000 ways that don't work.     but the secret to failure is
> 				       trying to please everybody.
> 	- Thomas Edison				- Bill Cosby
> -----------------------------------   ------------------------------------
> 
> On Fri, 4 Feb 2005, Dave Kettmann wrote:
> 
> > Hi all,
> >
> > I am new to RT and hope this will end up being the solution I am looking for.
> >
> > I have a couple questions about CustomFields. First, is there a limit to how many items you can have in a 'select one' field? I have alot of entries I need to put into this 'select one' CustomField, is there a way for me to manually create it? I tried looking for where my CustomFields might be stored, but I couldnt find them. I didnt see an option to import from a cvs or other type of file.
> >
> > Any help is appreciated.
> >
> > Thanks,
> >
> > Dave Kettmann
> > NetLogic
> > 636-561-0680
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> > RT Administrator and Developer training is coming to your town soon! (Boston, San Francisco, Austin, Sydney) Contact training at bestpractical.com for details.
> >
> > Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> >
> >
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> RT Administrator and Developer training is coming to your town soon! (Boston, San Francisco, Austin, Sydney) Contact training at bestpractical.com for details.
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com



More information about the rt-users mailing list