Import problems

Moderator: crythias

Locked
Kolkos
Znuny newbie
Posts: 6
Joined: 15 Apr 2011, 11:49
Znuny Version: 3.0.2
Real Name: Anton van der Kolk

Import problems

Post by Kolkos »

Hello all,

I have a few problems with importing CI's. I've made an import/export template. I've added an template CI to the class I want to export, if I run the export everything works just fine. The CSV contains the information from the template CI. If I add new CI information in the CSV file and try to import it again OTRS leaves most of the fields blank if I look in the AgentITSMConfigItemZoom. It looks like it doesn't add the information to the CMDB at all.

I have to say I did some tweaking to the ITSMConfigItems files in order to achieve this effect: http://bugs.otrs.org/show_bug.cgi?id=6676. The fields which are left blank are a sub of the type 'Structure'. I have tried to change the type to 'text' again, this doesn't help at all.

the log doesn't contain any information which is relevant. It only tells me that it import 643 items successfully.

Can someone help me with this problem? It is driving me nuts! :)

Kind regards,

Kolkos

PS. Some additional information:

Structure CI:

Code: Select all

[
 {
  Key => 'Owner',
  Name => 'Owner',
  Searchable => 1,
  Input => {
   Type => 'Customer',
  },
  CountMax => 16,
  CountDefault => 1,
 },

 #infoalgemeen
 {
 Key => 'Infoalgemeen',
 Name => 'Algemene Informatie',
 Input => {
  Type => 'Structure', 
  Size => 1, 
  MaxLength => 1,
 },
 Sub => [
   {
    Key => 'Vendor',
    Name => 'Vendor',
    Searchable => 1,
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
     Required => 1,
    },
   },
   {
    Key => 'Model',
    Name => 'Model',
    Searchable => 1,
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
     Required => 1,
    },
   },
   {
    Key => 'SerialNumber',
    Name => 'Serial Number',
    Searchable => 1,
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
     Required => 1,
    },
   },
   {
    Key => 'Ontwikkelmethode',
    Name => 'Ontwikkelmethode',
    Searchable => 1,
    Input => {
     Type => 'GeneralCatalog',
     Class => 'ITSM::CONFIGITEM::COMPUTER::ONTWIKKELMETHODE',
     Translation => 1,
           },
   },
   {
    Key => 'Bouwjaar',
    Name => 'Bouwjaar',
    Searchable => 1,
    Input => {
     Type => 'Text',
     Size => 25,
     MaxLength => 25,
    },
       },
  ],
 },

 #infoleverancier
 {
 Key => 'Infoleverancier',
 Name => 'Leveranciers Informatie',
 Input => {
  Type => 'Structure', 
  Size => 1, 
  MaxLength => 1,
 },
 Sub => [
   {
    Key => 'Leverancier',
    Name => 'Leverancier',
    Searchable => 1,
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
           },
   },
   {
    Key => 'SNleverancier',
    Name => 'Serienummer Leverancier',
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
    },
   },
  ],
 },
 #infouitlevering
 {
 Key => 'Infouitlever',
 Name => 'Uitleverings Informatie',
 Input => {
  Type => 'Structure', 
  Size => 1, 
  MaxLength => 1,
 },
 Sub => [
   {
    Key => 'Aanschafdatum',
    Name => 'Aanschafdatum',
    Searchable => 1,
    Input => {
     Type => 'Date',
     Required => 0,
    },
   },
   {
    Key => 'InstallDate',
    Name => 'Install Date',
    Searchable => 1,
    Input => {
     Type => 'Date',
     Required => 0,
    },
   },
   {
    Key => 'Uitroldatum',
    Name => 'Uitroldatum',
    Searchable => 1,
    Input => {
     Type => 'Date',
     Required => 1,
    },
   },
  ],
 },

 #infospecifiek
 {
 Key => 'Infospecifiek',
 Name => 'Specifieke Informatie',
 Input => {
  Type => 'Structure', 
  Size => 1, 
  MaxLength => 1,
 },
 Sub => [
   {
    Key => 'Rontgenbuis',
    Name => 'Röntgenbuis',
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
    },
    Sub => [
     {
      Key => 'RBType',
      Name => 'Type röntgenbuis',
      Input => {
       Type => 'Text',
       Size => 255,
       MaxLength => 255,
      },
     },
     {
      Key => 'RBSN',
      Name => 'Serienummer röntgenbuis',
      Input => {
       Type => 'Text',
       Size => 255,
       MaxLength => 255,
      },
     },
           ],
       },
       {
    Key => 'Diafragma',
    Name => 'Diafragma',
    Input => {
     Type => 'Text',
     Size => 255,
     MaxLength => 255,
    },
    Sub => [
     {
      Key => 'DFType',
      Name => 'Type diafragma',
      Input => {
       Type => 'Text',
       Size => 255,
       MaxLength => 255,
      },
     },
     {
      Key => 'DFSN',
      Name => 'Serienummer diafragma',
      Input => {
       Type => 'Text',
       Size => 255,
       MaxLength => 255,
      },
     },
     {
      Key => 'DFLamp',
      Name => 'Type lamp diafragma',
      Input => {
       Type => 'Text',
       Size => 255,
       MaxLength => 255,
      },            
     },
    ],
   },
  ],
 },            
 {
  Key => 'Note',
  Name => 'Note',
  Searchable => 1,
  Input => {
   Type => 'TextArea',
   Required => 1,
  },
  CountMin => 0,
  CountDefault => 0,
 },
];
Image

CSV after export template CI:

Code: Select all

naam1;Production;Operational;merk;model;serienummer;bouwjaar;14-5-2011;rbuis;df;notitie;hes-110428094255
Export CSV after imported CSV above:

Code: Select all

"Naam";"Production";"Operational";;;;;;;;;;;"notitie";"hes-110428094255"
Kolkos
Znuny newbie
Posts: 6
Joined: 15 Apr 2011, 11:49
Znuny Version: 3.0.2
Real Name: Anton van der Kolk

Re: Import problems

Post by Kolkos »

Solved it!

You have to add the "Structure" attributes to the import/export template. Something like this.
Image

In the CSV file you need to add a space in the row for the "Structure" attribute. Something like this:

Code: Select all

"RS-0001";"Production";"Operational";" ";"Summit";"Innovet";"CH 138-0697";"1997";"13-5-2011";" ";"Toshiba E7239X #7E086";"Summit V125";"Import via csv";"hes-11042733"
Thanks anyway ;)
Locked