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 a8ac8438f1..f72200b244 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
@@ -70,7 +70,7 @@
service_request
request_type
- incident
+
true
list
@@ -157,7 +157,7 @@
true
- service_id AND request_type = :this->request_type AND status != 'obsolete']]>
+ service_id AND (ISNULL(:this->request_type) OR request_type = :this->request_type) AND status != 'obsolete']]>
@@ -1196,10 +1196,21 @@
Overload-DBObject
Set('priority', $this->ComputePriority());
+ // Compute the request_type if not already defined (by the user)
+ $sType = $this->Get('request_type');
+ if (is_null($sType) || ($sType === ''))
+ {
+ $iSvcSubcat = $this->Get('servicesubcategory_id');
+ if ($iSvcSubcat != 0)
+ {
+ $sType = $this->Get('servicesubcategory_id->request_type');
+ $this->Set('request_type', $sType);
+ }
+ }
+
return parent::ComputeValues();
}]]>