Kernel::System::ITSMConfigItem::Version - sub module of Kernel::System::ITSMConfigItem
All version functions.
VersionZoomList()
return a config item version list as arrayhash reference
my $VersionListRef = $ConfigItemObject->VersionZoomList(
ConfigItemID => 123,
);
VersionList()
return a config item version list as array reference
my $VersionListRef = $ConfigItemObject->VersionList(
ConfigItemID => 123,
);
VersionGet()
returns a version of a config item as hash reference. The returned hash contains following attributes.
$Version{VersionID}
$Version{ConfigItemID}
$Version{Number}
$Version{ClassID}
$Version{Class}
$Version{LastVersionID}
$Version{Name}
$Version{DefinitionID}
$Version{DeplStateID}
$Version{DeplState}
$Version{DeplStateType}
$Version{CurDeplStateID}
$Version{CurDeplState}
$Version{CurDeplStateType}
$Version{InciStateID}
$Version{InciState}
$Version{InciStateType}
$Version{CurInciStateID}
$Version{CurInciState}
$Version{CurInciStateType}
$Version{XMLDefinition}
$Version{XMLData}
$Version{CreateTime}
$Version{CreateBy}
my $VersionRef = $ConfigItemObject->VersionGet(
VersionID => 123,
XMLDataGet => 1, # (optional) default 1 (0|1)
);
or
my $VersionRef = $ConfigItemObject->VersionGet(
ConfigItemID => 123,
);
When the date from the XML storage is not needed then fetching the XML data can be explicitly turned off by passing XMLDataGet => 0.
my $VersionRef = $ConfigItemObject->VersionGet(
ConfigItemID => 123,
XMLDataGet => 0,
);
The result of this call is not cached, as the next call to VersionGet() might need the XML data. On the other hand, when the cache is already filled, the cached version hash is returned with the XML data. So you get more than you asked for, which isn't a bad thing.
VersionConfigItemIDGet()
return the config item id of a version
my $ConfigItemID = $ConfigItemObject->VersionConfigItemIDGet(
VersionID => 123,
);
VersionAdd()
add a new version
my $VersionID = $ConfigItemObject->VersionAdd(
ConfigItemID => 123,
Name => 'The Name',
DefinitionID => 1212,
DeplStateID => 8,
InciStateID => 4,
XMLData => $ArrayHashRef, # (optional)
UserID => 1,
);
VersionDelete()
delete an existing version or versions
my $True = $ConfigItemObject->VersionDelete(
VersionID => 123,
UserID => 1,
);
or
my $True = $ConfigItemObject->VersionDelete(
ConfigItemID => 321,
UserID => 1,
);
VersionSearch()
return a config item list as an array reference
my $ConfigItemIDs = $ConfigItemObject->VersionSearch(
Name => 'The Name', # (optional)
ClassIDs => [ 9, 8, 7, 6 ], # (optional)
DeplStateIDs => [ 321, 123 ], # (optional)
InciStateIDs => [ 321, 123 ], # (optional)
PreviousVersionSearch => 1, # (optional) default 0 (0|1)
OrderBy => [ 'ConfigItemID', 'Number' ], # (optional)
# default: [ 'ConfigItemID' ]
# (ConfigItemID, Name, Number, ClassID, DeplStateID, InciStateID
# CreateTime, CreateBy, ChangeTime, ChangeBy)
# Additional information for OrderBy:
# The OrderByDirection can be specified for each OrderBy attribute.
# The pairing is made by the array indices.
OrderByDirection => [ 'Up', 'Down' ], # (optional)
# default: [ 'Up' ]
# (Down | Up)
Limit => 122, # (optional)
UsingWildcards => 0, # (optional) default 1
);
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.