ITSM:Config Item: Having multiple sub fields

Moderator: crythias

Post Reply
PGH
Znuny newbie
Posts: 3
Joined: 01 Mar 2017, 20:39
Znuny Version: 5.0.16
Real Name: Mike

ITSM:Config Item: Having multiple sub fields

Post by PGH »

Hello,

I am trying to figure out if a can have multiple sub fields for one parent field in a config item that I am using. For instance the default config item file for computer has the following:

{
Key => 'HardDisk',
Name => 'Hard Disk',
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
CountMax => 10,
Sub => [
{
Key => 'Capacity',
Name => 'Capacity',
Input => {
Type => 'Text',
Size => 20,
MaxLength => 10,
},
},
],
},

I need more than one attribute. So, in this case I would like 'Capacity" and another attribute like 'Color' as an example.

I really appreciate any help on this!

Mike
OTRS:Version: 5.0.16
Lamaman
Znuny newbie
Posts: 20
Joined: 08 Jan 2014, 10:33
Znuny Version: 4.0.15
Real Name: Maurice

Re: ITSM:Config Item: Having multiple sub fields

Post by Lamaman »

Something like this?

Code: Select all

{
  Key => 'HardDisk',
  Name => 'Hard Disk',
  Input => {
    Type => 'Text',
     Size => 50,
     MaxLength => 100,
   },
  CountMax => 10,
  Sub => [
{
  Key => 'Capacity',
  Name => 'Capacity',
  Input => {
    Type => 'Text',
    Size => 20,
    MaxLength => 10,
   },
},
{
       Key => 'Color',
       Name => 'Color',
       Input => {
           Type => 'Text',
           Size => 10,
           MaxLength => 10,
                },
    },
],
},
PGH
Znuny newbie
Posts: 3
Joined: 01 Mar 2017, 20:39
Znuny Version: 5.0.16
Real Name: Mike

>SOLVED<: ITSM:Config Item: Having multiple sub fields

Post by PGH »

Perfect! Thank you very much. I must have had a { in the wrong place.

Thanks again,
Mike
Post Reply