diff --git a/src/automation/service/AutomationServiceServicerImpl.py b/src/automation/service/AutomationServiceServicerImpl.py
index 27af8db95d4de7da8212e26fbb836b12b2c8aa8d..fa079b7b79dbd956a77a6004248b6843a5c7cf0d 100644
--- a/src/automation/service/AutomationServiceServicerImpl.py
+++ b/src/automation/service/AutomationServiceServicerImpl.py
@@ -153,7 +153,9 @@ class AutomationServiceServicerImpl(AutomationServiceServicer):
             analyzer.input_kpi_ids.append(kpi_id_tx)
             analyzer.output_kpi_ids.append(kpi_id_lat)
 
-            _threshold_dict = {'min_latency_E2E': (0, service.service_constraints[0].sla_latency.e2e_latency_ms)}
+            thresholdStr = service.service_constraints[0].custom.constraint_type
+
+            _threshold_dict = {thresholdStr: (0, int(service.service_constraints[0].custom.constraint_value))}
             analyzer.parameters['thresholds'] = json.dumps(_threshold_dict)
             analyzer.parameters['window_size'] = "60s"
             analyzer.parameters['window_slider'] = "30s"
diff --git a/src/tests/hackfest3/tests/test_functional_create_service.py b/src/tests/hackfest3/tests/test_functional_create_service.py
index acded924d09d9cbbf72e9012126bb3d68055725f..a358c4c022be3216e29c23515a3192c8acbe8ce1 100644
--- a/src/tests/hackfest3/tests/test_functional_create_service.py
+++ b/src/tests/hackfest3/tests/test_functional_create_service.py
@@ -28,7 +28,7 @@ from service.client.ServiceClient import ServiceClient
 from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, SERVICES
 from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId,\
     DeviceOperationalStatusEnum
-from common.tools.object_factory.Constraint import json_constraint_sla_latency
+from common.tools.object_factory.Constraint import json_constraint_custom
 
 LOGGER = logging.getLogger(__name__)
 LOGGER.setLevel(logging.DEBUG)
@@ -63,5 +63,5 @@ def test_rules_entry(
         service_p4 = copy.deepcopy(service)
         service_client.CreateService(Service(**service_p4))
         service_p4['service_endpoint_ids'].extend(endpoints)
-        service_p4['service_constraints'].extend([json_constraint_sla_latency(3)])
+        service_p4['service_constraints'].extend([json_constraint_custom('min_latency_E2E','2')])
         service_client.UpdateService(Service(**service_p4))