CI Modeling with YAML in the OTOBO Ticket System
This chapter shows how to define and extend your Configuration Items (CIs) in the OTOBO ticket system using YAML—from the page and layout structure to dynamic fields and field types.
1. Structure of CI Definitions
Each CI definition in OTOBO consists of several main components:
yaml
- Class:
Name: <CI-Class>
Categories:
- All
- <Other Categories>
NumberModule: AutoIncrement
PermissionGroup: itsm-configitem
VersionStringModule: Incremental
Definition: |
Pages:
- Name: Summary
Layout:
Columns: 3
ColumnWidth: 1fr 1fr 1fr
Interfaces:
- Agent
- Customer
Content:
- Section: General Fields::General Information
RowStart: 1
ColumnStart: 1
- Section: ITSM Model::Model
RowStart: 1
ColumnStart: 2
- Section: CMDB Description::Description
RowStart: 2
ColumnStart: 1
ColumnSpan: 2
DynamicFields: { … }
1.1 Pages
- Name: The label of the tab in the agent zoom view.
- Interfaces: Controls who can see the tab (Agent, Customer, etc.).
- Content: A list of sections with their position (RowStart, ColumnStart, and optionally Span).
1.2 Layout
- Columns: The number of columns in the tab.
- ColumnWidth: Proportional width specifications (e.g.,
1fr 2fr 1fr
).
1.3 Roles
Roles define reusable sections and field lists:
yaml
- Definition: |
Sections:
General Information:
Content:
- Header: General Information
- DF: System-Name
- DF: System-Version
Relations:
Type: ConfigItemLinks
Header: Relations
RoleName: CMDB General Fields
- RoleName: The unique name of the role.
- Sections: Contains one or more sections with field references (
DF:
).
2. Dynamic Fields (DynamicFields) and Field Types
With DynamicFields, you can extend your CI classes with custom attributes. Each field is assigned a name, type, and configuration:
yaml
DynamicFields:
DynamicFieldName:
FieldType: Text
Label: My Label
Name: System-Name
ObjectType: ITSMConfigItem
Config:
DefaultValue: 'demo'
MultiValue: '0'
PossibleNone: '1'
Tooltip: ''
System-LifecycleStatus:
FieldType: Dropdown
Label: Lifecycle status of system
Name: System-LifecycleStatus
ObjectType: ITSMConfigItem
Config:
DefaultValue: ''
MultiValue: '0'
PossibleNone: '1'
PossibleValues:
demo: demo
productive: productive
Tooltip: ''
2.1 Important Field Types
FieldType | Description |
---|---|
Text | Simple single-line field |
TextArea | Multi-line free text field |
Date | Date field (with restrictions via YearsInPast/... ) |
Dropdown | Selection field (single/multi via MultiValue ) |
Agent | LDAP user/agent lookup |
ConfigItem | Link to another CI (relation type can be defined) |
ScriptTemplateToolkit | Calculated field via a template (e.g., sums) |
2.2 Configuration Options
- DefaultValue: The default value when creating a new item.
- MultiValue:
'0'
(single selection) or'1'
(multiple). - PossibleNone:
'1'
to allow an empty selection. - PossibleValues: Key-value pairs for dropdown fields.
- EditFieldMode: e.g.,
Dropdown
,AutoComplete
. - ReferenceFilterList, ReferencedObjectType: For lookup fields.
3. Example
yaml
- Class:
Name: CIName
Categories:
- All
- IT
NumberModule: AutoIncrement
PermissionGroup: itsm-configitem
VersionStringModule: Incremental
Definition: |
Pages:
- Name: Intro
Layout:
Columns: 2
ColumnWidth: 1fr 1fr
Interfaces:
- Agent
Content:
- Section: CMDB General Fields::Information
RowStart: 1
ColumnStart: 1
- Section: CMDB General Fields::Risks
RowStart: 2
ColumnStart: 1
- Name: Details
Layout:
Columns: 1
ColumnWidth: 1fr
Interfaces:
- Agent
Content:
- Section: CMDB General Fields::Software
RowStart: 1
ColumnStart: 1
DynamicFields:
System-Name: { … }
System-Version: { … }
System-LifecycleStatus: { … }
4. Tips and Best Practices
- Modularity: Use roles for recurring sections.
- Clarity: Group related fields into their own pages.
- Documentation: Comment your YAML files and maintain version triggers.
- Testing: Validate new fields in a test instance first.
With this structure, you can flexibly adapt the OTOBO CMDB to your organizational requirements and keep it transparent at all times.