NAME
Kernel::System::SysConfig::Base::OTRSSystemConfigurationHistory – Base class extension for system configuration to enable OTRSSystemConfigurationHistory features.
PUBLIC INTERFACE
SettingHistory()
Returns the complete tracking of changes for a setting, the default, current and modified values for a given setting.
my %Result = $SysConfigObject->SettingHistory(
DefaultID => 45, # optional
Name => 'Setting Name', # optional
ModifiedID => 123, # optional
);
Returns:
%Result = (
Modified => [
{
DefaultID => 123,
ModifiedID => 456,
Name => "ProductName",
Description => "Defines the name of the application ...",
# . . .
},
# . . . All the modified versions for this setting
],
Default => [
{
DefaultID => 123,
ModifiedID => 456,
Name => "ProductName",
Description => "Defines the name of the application ...",
. . .
},
# . . . All the default versions for this setting
},
Current => {
DefaultID => 123,
ModifiedID => 456,
Name => "ProductName",
Description => "Defines the name of the application ...",
# . . .
},
);
SettingRevertHistoricalValue()
Revert setting value to a previous point in history.
my $Result = $SysConfigObject->SettingRevertHistoricalValue(
Name => 'Setting Name',
ModifiedVersionID => 123, # the id of the modified version to restore its value
UserID => 1,
);
Returns:
$Result = 1; # or false in case of an error
SettingPreviousValueGet()
Returns the previous content for a given setting.
my %Result = $SysConfigObject->SettingPreviousValueGet(
Name => 'Setting Name',
ModifiedVersionID => 456,
);
Returns:
%Result = (
Name => 'TestSetting',
EffectiveValue => 'AValue',
# ...
);
ConfigurationDeployRestore()
Restore a deployment from history.
– If a settings does not exist it should be skipped – If settings value does not match it is skipped but show a log – Deployment restore only reset modified settings to a certain version (set by deployment date) – Once the settings has been restored to the correct version a new deployment has to be done (this could be optional as the admin might want to review first, so it should not be implemented by the function).
my $Result = $SysConfigObject->ConfigurationDeployRestore(
DeploymentID => 123, # the deployment id
UserID => 456,
);
Returns:
$Result = 1; # or 0 if restore configuration was not possible.