diff options
author | Tikhon Uskov <tikhon.uskov@zabbix.com> | 2020-11-17 09:53:54 +0300 |
---|---|---|
committer | Tikhon Uskov <tikhon.uskov@zabbix.com> | 2020-11-17 09:53:54 +0300 |
commit | 6b51e48c49ea7e782999efadfa97d50b9a9a3b9b (patch) | |
tree | 45076529003dcf75f2b62d180f1b7b54be1177a3 /templates/media | |
parent | 8d59883d800ee8a73b135351d9c781fc14212896 (diff) |
.........T [ZBXNEXT-6316] fixed after QA
Diffstat (limited to 'templates/media')
-rw-r--r-- | templates/media/itop/media_itop.yaml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/media/itop/media_itop.yaml b/templates/media/itop/media_itop.yaml index d3ce5e4d2f6..dcb6a461c62 100644 --- a/templates/media/itop/media_itop.yaml +++ b/templates/media/itop/media_itop.yaml @@ -82,7 +82,9 @@ zabbix_export: json_data.operation = 'core/create'; json_data.fields.org_id = Itop.params.organization_id; json_data.fields.title = params.alert_subject; - json_data.fields.description = params.alert_message.replace(/(?:\r\n|\r|\n)/g, '<br>'); + json_data.fields.description = params.alert_message.replace('<', '<') + .replace('>', '>') + .replace(/(?:\r\n|\r|\n)/g, '<br>'); }, setUpdatePayload: function () { @@ -98,10 +100,10 @@ zabbix_export: }, request: function (data) { - ['url', 'user', 'password', 'organization_id', 'class', 'api_version'].forEach(function (field) { + ['url', 'user', 'password', 'organization_id', 'class', 'api_version', 'id'].forEach(function (field) { if (typeof Itop.params !== 'object' || typeof Itop.params[field] === 'undefined' || Itop.params[field] === '' ) { - throw 'Required Itop param is not set: "' + field + '".'; + throw 'Required Itop param is not set: "itop_' + field + '".'; } }); @@ -225,6 +227,9 @@ zabbix_export: } // Update created issue for trigger-based event. else { + if (Itop.params.id === '{EVENT.TAGS.__zbx_itop_id}') { + throw 'Incorrect iTop ticket ID given: ' + Itop.params.id; + } Itop.setUpdatePayload(); Itop.request(json_data); } |