-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
7.0.16
Steps to reproduce:
Tested in Jira v10.3 and v10.4 self-managed setup
- Import latest Jira media version (24/Mar/2025)
- Configure action and media
- Trigger a problem
- Update the problem in Zabbix (add a comment or ack it)
Result:
The media fails to update the Jira issue with the following error:
Sending failed: Failed to parse response: not well-formed JSON was received
I've managed to make it work but I don't know if this is a proper fix (I'm not a Javascript expert). In line 456 variable "resp" might be empty, so I put the try-catch inside an if:
if (resp != '') { try { resp = JSON.parse(resp); } catch (error) { throw 'Failed to parse response: not well-formed JSON was received'; } }
Also I found Jira is returning HTTP204 to the update request (the petition is ok, but empty response), so I changed line 649 from this:
if ((this.request.getStatus() !== 200 && this.request.getStatus() !== 201)) {
to this:
if ((this.request.getStatus() !== 200 && this.request.getStatus() !== 201 && this.request.getStatus() !== 204)) {
Expected:
Jira media updates the issue and Zabbix marks the action as succesfully executed.