[ZBX-20080] Slack integration script Created: 2021 Oct 12  Updated: 2024 Apr 10  Resolved: 2021 Nov 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D), Templates (T)
Affects Version/s: 5.0.16, 5.4.7
Fix Version/s: 5.0.18rc1, 5.4.8rc1, 6.0.0alpha6, 6.0 (plan)

Type: Problem report Priority: Major
Reporter: logabot Assignee: Andrew Biba
Resolution: Fixed Votes: 1
Labels: Slack, documentation, templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2021-10-12 at 16.24.40.png    
Issue Links:
Duplicate
is duplicated by ZBX-20130 Slack integration script contains inv... Closed
Team: Team INT
Story Points: 0.25

 Description   

Steps to reproduce:

  1. Install Zabbix Server LTS 5.0
  2. Download media_slack.xml from https://www.zabbix.com/ru/integrations/slack(), but you need download from source (sic), because in Zabbix Server(frontend) 5.0 yaml is unsupported extension
  3. Import new media type
  4. Click test + send test

Result:
Details Media type test failed.
SyntaxError: unterminated statement (line 116)
Expected:
Success

It happened because single quote not escaped.
this (x2)

 throw 'Can't process event tags: ' + error;

to

 throw 'Can\'t process event tags: ' + error;

https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/slack/media_slack.xml?at=refs%2Ftags%2F5.0.16#268
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/slack/media_slack.xml?at=refs%2Ftags%2F5.0.16#234



 Comments   
Comment by Edgar Akhmetshin [ 2021 Oct 12 ]

Hello,

Git repository provides both xml/yaml according to the version used:
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/slack?at=refs%2Fheads%2Frelease%2F5.0

But agree with quoting issue and also version selector here https://www.zabbix.com/integrations/slack does nothing:

It should switch link provided for XML or YAML version.

Confirmed.

Regards,
Edgar

Comment by Max B [ 2021 Oct 15 ]

Confirming this is occurring on Zabbix 5.4 running on Ubuntu 20.04.3 LTS 

Getting same error:

Details Media type test failed. SyntaxError: unterminated statement (line 116)

Fixed by escaping the two "can't" statements.

Comment by Andrew Biba [ 2021 Nov 01 ]

Available in:

Generated at Fri May 02 10:22:39 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.