diff --git a/html/includes/modal/new_alert_rule.inc.php b/html/includes/modal/new_alert_rule.inc.php
index 7c014e31cd..2c16bd4bec 100644
--- a/html/includes/modal/new_alert_rule.inc.php
+++ b/html/includes/modal/new_alert_rule.inc.php
@@ -357,7 +357,7 @@ $('#and').click('', function(e) {
strategy: 'array',
tagFieldName: 'rules[]'
});
- if(value.indexOf("%") < 0) {
+ if(value.indexOf("%") < 0 && isNaN(value)) {
value = '"'+value+'"';
}
if(entity.indexOf("%") < 0) {
diff --git a/html/includes/modal/new_device_group.inc.php b/html/includes/modal/new_device_group.inc.php
index edb1110536..220596f1a3 100644
--- a/html/includes/modal/new_device_group.inc.php
+++ b/html/includes/modal/new_device_group.inc.php
@@ -181,11 +181,13 @@ $('#and, #or').click('', function(e) {
strategy: 'array',
tagFieldName: 'patterns[]'
});
- if(entity.indexOf("%") >= 0) {
- $('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
- } else {
- $('#response').data('tagmanager').populate([ '%'+entity+' '+condition+' "'+value+'" '+glue ]);
+ if(value.indexOf("%") < 0 && isNaN(value)) {
+ value = '"'+value+'"';
}
+ if(entity.indexOf("%") < 0) {
+ entity = '%'+entity;
+ }
+ $('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
}
});