-
Bug
-
Resolution: Unresolved
-
Low
-
Severity 3 - Minor
Issue Summary
When the payload sent to a JIra Automation Webhook trigger contains a field/object named "data", it's value can't be accessed using the smart value webhookData. The exact same JSON path can be parsed correctly if we replace "data" by anything else.
In the following payload, it is impossible to retreive the value at webhookData.data.essentials.alertRule.
{ "schemaId": "AWMonitorCommonAlertSchema", "data": { "essentials": { "alertId": "/subscriptions/acfdb80a-aa1b-c12c-ac3d-eeeeee4e4e4e/providers/Microsoft.AlertsManagement/alerts/aaaa0a0a-bb1b-cc2c-dd3d-e128456e4e4e4e", "alertRule": "TERPZ-R2-Gen2" } } }
If you replace "data" by anything else, like "potato", the value will be parsed correctly.
This is reproducible on Data Center: (yes) / (no)
Steps to Reproduce
- Create a automation rule with an incoming webhook for the trigger.
- Add a log action and log "{{webhookData.data.essentials.alertRule}}"
- Set up Postman to post to the incoming webhooks url. Include the data set from above
- Send the POST message from postman to the webhook
- Check audit logs
Expected Results
Audit log would show "TERPZ-R2-Gen2" in the log entry
Actual Results
the log entry is blank under the log action
Workaround
Change the key name from "data" to something else and reference that key in the log action
The bug has been identified and is reproducible. In JiraIncomingWebhookTriggerExecutor.java, when processing incoming webhook events, the payload behaves differently based on the first nested key. If the first nested key is "data", it is ignored. However, if it is "potato" or values other than data it is processed correctly. This suggests a potential issue with deserialisation logic, possibly involving Jackson, due to specific handling or conflict with the key.
Example Log Outputs:
{"essentials":{"alertId":"/subscriptions/acfdb80a-aa1b-c12c-ac3d-eeeeee4e4e4e/providers/Microsoft.AlertsManagement/alerts/aaaa0a0a-bb1b-cc2c-dd3d-e128456e4e4e4e",
{"potato":{"essentials":{"alertId":"/subscriptions/acfdb80a-aa1b-c12c-ac3d-eeeeee4e4e4e/providers/Microsoft.AlertsManagement/alerts/aaaa0a0a-bb1b-cc2c-dd3d-e128456e4e4e4e",
To ensure you can access your data correctly, avoid using "data" as the first nested key in your payload structure. This can help prevent potential issues when retrieving values.
For example:
If your payload is structured as {value: { data: '123' }}, you can access the data using webhookData.value.data, and it will correctly return '123'.
However, if your payload is structured as {data:
{ author: '123' }}, you should access the value directly using webhookData.author, which will return '123'.