[ZBX-23537] {EVENT.TAGS.<tag name>} has no value for recovery in webhook Created: 2023 Oct 12  Updated: 2024 May 17

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S), Templates (T)
Affects Version/s: 5.0.38
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: itcbsops Assignee: Zabbix Integration Team
Resolution: Unresolved Votes: 0
Labels: event, jira, jsm, recovery, tags, webhook
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Production


Attachments: PNG File image-2023-10-12-10-21-43-184.png     PNG File image-2023-10-12-10-22-06-690.png     PNG File image-2024-05-17-10-16-53-697.png     PNG File image-2024-05-17-10-17-09-366.png    

 Description   

Hi,
When problem and recovery event happen quickly, the recovery event doesn't have a value for

{EVENT.TAGS.<tag name>}

, which causes the action/webhook to fail.

1) the trigger raises a problem event
2) the action opens a Jira/JSM ticket via the mediatype/webhook
3) while the action is still executing (API call to Jira), a recovery event happens
4) the action fails because {EVENT.TAGS.<tag name>} value is not known.

 

 

Select *
from ZABBIXADM.EVENTS events, ZABBIXADM.ALERTS alerts
where ALERTS.EVENTID = EVENTS.EVENTID and mediatypeid = 6 and parameters like '%246903462%' --and parameters like '%recovery%'
order by alerts.clock desc



 Comments   
Comment by itcbsops [ 2023 Nov 27 ]

I have yet another example today.

  • The event started at    2023-11-27 09:23:17     and finished at 2023-11-27 09:34:55
  • For some reason (I am not Zabbix admin), the action that makes the API call to Jira was delayed
    • The first API call to Jira was made at  2023-11-27 09:56:43. That's about 20 minutes after the event was actually closed in Zabbix.
    • The second call to close the Jira issue was only made later at 2023-11-27 10:11:36
      • This call was rejected by Jira because some values weren't replaced properly. I assume this is because the even was already closed in Zabbix.
        • "jira_issue_key": "{EVENT.TAGS.__zbx_jira_issuekey}" <-- the issue key is missing

Here is the dump of the second JSON sent to Jira:

 

Jira WebHook error: Request failed with status code 404: ["Issue Does Not Exist"] Check debug log for more information. 

{
  "z_alert_subject": "[AM_APP-CTCPRD-VH] TRG_Gresham_CTC_Web_GUI_HTTPS_via_F5 (TMPL_ITCBSOPS_CTC)",
  "z_alert_txt_message": "(/) Recovery detected. Closing issue.",
  "event_recovery_value": "0",
  "event_source": "0",
  "event_tags_json": "[]",
  "event_update_action": "{EVENT.UPDATE.ACTION}",
  "event_update_message": "{EVENT.UPDATE.MESSAGE}",
  "event_update_status": "0",
  "event_update_user": "{USER.FULLNAME}",
  "event_value": "0",
  "jira_appli": "GLOR-704",
  "jira_issue_key": "{EVENT.TAGS.__zbx_jira_issuekey}",
  "jira_issue_type": "Alert",
  "jira_password": "xxYY",
  "jira_project_key": "IOR",
  "jira_severity": "4",
  "jira_stage": "GLOR-31",
  "jira_team": "GLOR-188",
  "jira_transition_id": "11",
  "jira_url": "https://jira.prd.apps.sebp/",
  "jira_user": "JSM_Zabbix_PRD",
  "jira_team_manager": "ATL_JSM_Team_CBS-Ops_Manager",
  "jira_team_member": "ATL_JSM_Team_CBS-Ops_Member",
  "jira_zbxlink": "https://zabbix.prd.apps.bdl//zabbix/tr_events.php?triggerid=917532&eventid=417477962"
}

I don't know what is causing the delay in executing the action, but nevertheless, I don't think it is normal to have a missing issue key.

Comment by Evgenii Gordymov [ 2024 May 17 ]

Hi, it.sdm!

Tried to reproduce a similar case using the current version of JS.

In my case everything is working as expected, check the network connection between Zabbix server and Jira server (there may be long delays)

 

184: 20240517: 105859.737 [ Jira Service Desk Webhook] Received response with status code 201

{
   "_expands": [
      "attachment",
      "renderedBody"
   ],
   "id": "10234",
   "body": "Problem has been resolved in 20s at 10:58:57 on 2024.05.17\r\nProblem name: Trigger for Jira tikets\r\nHost: test\r\nSeverity: High\r\nOriginal problem ID: 271160",
   "public": true,
   "author": {
      "accountId": "607d8726956733006982f2a9",
      "emailAddress": "***@mail.com",
      "displayName": "Evgenii Gordymov",
      "active": true,
      "timeZone": "Europe/Riga",
      "_links": {
         "jiraRest": "https://***.atlassian.net/rest/api/2/user?accountId=607d8726956733006982f2a9",
         "avatarUrls": {
            "48x48": "https://secure.gravatar.com/avatar/c2bef9207505e9d6b24df0ab14629a2a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FEG-4.png",
            "24x24": "https://secure.gravatar.com/avatar/c2bef9207505e9d6b24df0ab14629a2a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FEG-4.png",
            "16x16": "https://secure.gravatar.com/avatar/c2bef9207505e9d6b24df0ab14629a2a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FEG-4.png",
            "32x32": "https://secure.gravatar.com/avatar/c2bef9207505e9d6b24df0ab14629a2a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FEG-4.png"
         },
         "self": "https://***.atlassian.net/rest/api/2/user?accountId=607d8726956733006982f2a9"
      }
   },
   "created": {
      "iso8601": "2024-05-17T10:58:59+0300",
      "jira": "2024-05-17T11:58:59.520+0400",
      "friendly": "Today 10:58 AM",
      "epochMillis": 1715932739520
   },
   "_links": {
      "self": "https://***.atlassian.net/rest/servicedeskapi/request/10453/comment/10234"
   }
} 

 

Generated at Thu May 01 06:57:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.