diff --git a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml
index a5734437e..04cc671a7 100755
--- a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml
+++ b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml
@@ -1215,21 +1215,36 @@
false
public
Internal
- Get('status') != 'resolved')
+ if ($this->Get('status') != 'resolved' && $this->Get('status') != 'closed' )
{
- $this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
- $this->Set('service_id', $oParentTicket->Get('service_id'));
- $this->Set('team_id', $oParentTicket->Get('team_id'));
- $this->Set('agent_id', $oParentTicket->Get('agent_id'));
- $this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
+ $aDummy = array();
+ $aExcludedAttributes = array('team_id', 'agent_id');
+ foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode => $oAttDef)
+ {
+ // Exclude inter dependant attributes to keep consistency
+ if(in_array($sAttCode, $aExcludedAttributes))
+ {
+ continue;
+ }
+
+ if (($this->GetAttributeFlags($sAttCode, $aDummy, 'resolved') & OPT_ATT_MANDATORY) && empty($this->Get($sAttCode)))
+ {
+ $this->Set($sAttCode, $oParentTicket->Get($sAttCode));
+ }
+ }
+ if (($this->Get('team_id') == 0) || ($this->Get('agent_id') ==0))
+ {
+ $this->Set('team_id', $oParentTicket->Get('team_id'));
+ $this->Set('agent_id', $oParentTicket->Get('agent_id'));
+ }
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
$this->ApplyStimulus('ev_autoresolve');
$this->DBUpdate();
}
- }]]>
+ }]]>
false
diff --git a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml
index effe9bf40..073fba1d7 100755
--- a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml
+++ b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml
@@ -1315,21 +1315,36 @@
false
public
Internal
- Get('status') != 'resolved')
+ if ($this->Get('status') != 'resolved' && $this->Get('status') != 'closed' )
{
- $this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
- $this->Set('service_id', $oParentTicket->Get('service_id'));
- $this->Set('team_id', $oParentTicket->Get('team_id'));
- $this->Set('agent_id', $oParentTicket->Get('agent_id'));
- $this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
+ $aDummy = array();
+ $aExcludedAttributes = array('team_id', 'agent_id');
+ foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode => $oAttDef)
+ {
+ // Exclude inter dependant attributes to keep consistency
+ if(in_array($sAttCode, $aExcludedAttributes))
+ {
+ continue;
+ }
+
+ if (($this->GetAttributeFlags($sAttCode, $aDummy, 'resolved') & OPT_ATT_MANDATORY) && empty($this->Get($sAttCode)))
+ {
+ $this->Set($sAttCode, $oParentTicket->Get($sAttCode));
+ }
+ }
+ if (($this->Get('team_id') == 0) || ($this->Get('agent_id') ==0))
+ {
+ $this->Set('team_id', $oParentTicket->Get('team_id'));
+ $this->Set('agent_id', $oParentTicket->Get('agent_id'));
+ }
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
$this->ApplyStimulus('ev_autoresolve');
$this->DBUpdate();
}
- }]]>
+ }]]>
false
diff --git a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml
index 1b5f9db17..c7122fa83 100755
--- a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml
+++ b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml
@@ -1340,19 +1340,34 @@
Internal
Get('status') != 'resolved')
+ if ($this->Get('status') != 'resolved' && $this->Get('status') != 'closed' )
{
- $this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
- $this->Set('service_id', $oParentTicket->Get('service_id'));
- $this->Set('team_id', $oParentTicket->Get('team_id'));
- $this->Set('agent_id', $oParentTicket->Get('agent_id'));
- $this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
+ $aDummy = array();
+ $aExcludedAttributes = array('team_id', 'agent_id');
+ foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode => $oAttDef)
+ {
+ // Exclude inter dependant attributes to keep consistency
+ if(in_array($sAttCode, $aExcludedAttributes))
+ {
+ continue;
+ }
+
+ if (($this->GetAttributeFlags($sAttCode, $aDummy, 'resolved') & OPT_ATT_MANDATORY) && empty($this->Get($sAttCode)))
+ {
+ $this->Set($sAttCode, $oParentTicket->Get($sAttCode));
+ }
+ }
+ if (($this->Get('team_id') == 0) || ($this->Get('agent_id') ==0))
+ {
+ $this->Set('team_id', $oParentTicket->Get('team_id'));
+ $this->Set('agent_id', $oParentTicket->Get('agent_id'));
+ }
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
$this->ApplyStimulus('ev_autoresolve');
$this->DBUpdate();
}
- }]]>
+ }]]>
false