[rt-users] Problem importing global keywords from 2.0.14 to 3.0.2pre3

Gary Oberbrunner garyo at genarts.com
Tue May 6 15:46:06 EDT 2003


I'm having trouble converting global keywords from our 2.0.14 RT to our 
new 3.0.2pre3.  I'm using version 11 of the rt2-to-rt3 scripts.  The 
problem seems to be that the metadata file from rt2 contains this kind 
of structure for the global keywords:
   sub Data {
   $VAR1 = {
           'Global' => {
                         '6' => {
                                  'Value' => [
                                               'Crashing',
                                               'Crashing/Memory',
                                               'Enhancement Idea',
                                               'Installation',
                                               'Licensing',
                                               'Parameters',
                                               'Rendering',
                                               'Startup'
                                             ],
                                  'ObjectField' => 'Queue',
                                  'id' => '6',
                                  'Name' => 'Problem Type',
                                  'Keyword' => '48',
                                  'ObjectType' => 'Ticket'
                                },

In other words, the Problem Type keyword object is the value of the 
member '6' of Globals.  To get to that keyword object, you would say 
$VAR1->{'Global'}->'6' which does not seem right. (how does it know that 
these are custom fields, for instance?)   The dumpfile-to-rt-3.0 code 
seems to expect it to be an array of CustomField objects, because it 
tries to loop over them like this:

   foreach my $cf ( @{ $VAR1->{'Global'}->{'CustomField'} } ) {
     my $type;
     my $cfobj = RT::CustomField->new($RT::SystemUser);
     if ( $cf->{'Single'} ) {
         $type = 'SelectSingle';
     }
     else {
         $type = 'SelectMultiple';
     }
     $cfobj->Create( Name => $cf->{'Name'}, Type => $type, Queue => '0',
       ...

so it seems like it expects $VAR1->{'Global'}->{'CustomField'}, as an 
array (not a hash).  The two sides really don't match up at all.  Does 
anyone know how this is intended to work?  Does it work for anyone?

thanks!

-- 
. . . . . . . . . . . . . . . . . . . . . . . . .
Gary Oberbrunner                garyo at genarts.com
GenArts, Inc.                   Tel: 617-492-2888
8 Clinton Street                Fax: 617-492-2852
Cambridge, MA 02139 USA         http://web.genarts.com





More information about the rt-users mailing list