NAME
Kernel::System::ServiceCatalogue::Item
DESCRIPTION
All Service Catalogue Item functions.
PUBLIC INTERFACE
BUILD()
Customization of object construction, do not use it directly.
ItemAdd()
Adds new Item in Service Catalogue.
my $Success = $ItemObject->ItemAdd(
InternalTitle => 'Item', # (required) Item title
ValidID => 1, # (required) ValidID
UserID => 1, # (required) UserID
);
ItemGet()
Get Item data.
my %Item = $ItemObject->ItemGet(
ItemID => 1, # (required) Item ID
# or
InternalTitle => 'item', # (required) Internal Title
);
Returns:
%Item = (
ItemID => 1,
InternalTitle => 'Item name',
UsageCounter => 0,
ValidID => 1,
CreateBy => 1,
CreateTime => '2018-07-20 12:00:00',
ChangeBy => 1,
ChangeTime => '2018-07-20 12:00:00',
Content => {
'de' => {
ItemContentID => 123,
Title => 'title',
Text => 'text',
Link => 'www.otrs.com',
CreateTime => '2018-07-20 12:00:00',
CreateBy => 1,
ChangeTime => '2018-07-20 12:00:00',
ChangeBy => 1,
CategoryIDs => [1, 2, 3],
},
},
);
ItemList()
Lists Items in Service Catalogue.
my @Items = $ItemObject->ItemList(
Valid => 1, # (optional) List only valid Items
CategoryID => 123, # (optional)
);
Returns:
@Items = (
{
ItemID => 1,
InternalTitle => 'Item name',
UsageCounter => 0,
ValidID => 1,
CreateBy => 1,
CreateTime => '2018-07-20 12:00:00',
ChangeBy => 1,
ChangeTime => '2018-07-20 12:00:00',
Content => {
'de' => {
ItemContentID => 123,
Title => 'title',
Text => 'text',
Link => 'www.otrs.com',
CreateTime => '2018-07-20 12:00:00',
CreateBy => 1,
ChangeTime => '2018-07-20 12:00:00',
ChangeBy => 1,
CategoryIDs => [1, 2, 3],
},
...
},
},
...
);
ItemSearch()
Search for Items.
my @Items = $ItemObject->ItemSearch(
Language => 'en', # (required) Language
CategoryID => 123, # (optional) CategoryID
Valid => 1, # (optional) Return only valid items
);
Returns:
@Items = (
{
ItemID => 123,
Title => 'Title in english',
Text => 'English content',
Link => 'www.otrs.com',
CategoryID => 123,
},
...
);
ItemDelete()
Delete Item and Item content from the Service Catalogue.
my $Success = $ItemObject->ItemDelete(
ItemID => 123, # (required) ItemID
);
ItemUpdate()
Update Item in Service Catalogue.
my $Success = $ItemObject->ItemUpdate(
ItemID => 1, # (required) ItemID to update
InternalTitle => 'Category name', # (required) Internal title
ValidID => 2, # (required) ValidID
UserID => 1, # (required) UserID
);
ItemUsageCounterIncrease()
Increase usage counter for provided ItemID.
my $Success = $ItemObject->ItemUsageCounterIncrease(
ItemID => 1, # (required) Item ID to update
);
ItemContentAdd()
Adds Item content.
my $ItemContentID = $ItemObject->ItemContentAdd(
ItemID => 123, # (required) ItemID
Title => 'Item', # (required) Item title
Text => 'Text', # (required) Item text
Language => 'en', # (required) Item language
UserID => 1, # (required) UserID
Link => 'www.otrs.com', # (required) Link
);
Result: $ItemContentID = 123;
ItemContentGet()
Get Item content data.
my %ItemContent = $ItemObject->ItemContentGet(
ItemContentID => 123, # (required) ItemContentID
);
Result:
%ItemContent = (
ItemContentID => 123
ItemID => 245,
Title => 'Item',
Text => 'Text',
Language => 'en',
Link => 'www.otrs.com',
CreateBy => 1,
CreateTime => '2018-07-20 12:00:00',
ChangeBy => 1,
ChangeTime => '2018-07-20 12:00:00',
CategoryIDs => [1, 2, 3],
);
ItemContentUpdate()
Updates Item content.
my $Success = $ItemObject->ItemContentUpdate(
ItemContentID => 123, # (required) ItemContentID
ItemID => 123, # (required) ItemID (can't be updated)
Title => 'Item', # (required) Item title
Text => 'Text', # (required) Item text
UserID => 1, # (required) UserID
Link => 'www.otrs.com', # (required) Link
);
Events: ItemContentUpdate
ItemContentDelete()
Delete Item content from the Service Catalogue.
my $Success = $ItemObject->ItemContentDelete(
ItemContentID => 123, # (required) ItemContentID
ItemID => 123, # (required) ItemID
);
Events: ItemContentDelete
ItemContentCategorySet()
Set Item Categories.
my $Success = $ItemObject->ItemContentCategorySet(
ItemContentID => 123, # (required) ItemContentID
CategoryIDs => [ # (required) List of Category IDs
123,
124,
...
],
UserID => 1, # (required) UserID
);
Events: ItemContentCategorySet