-
New Feature Request
-
Resolution: Unresolved
-
Minor
-
7.0.0, 7.2.0alpha1
-
None
-
Prev.Sprint, S24-W38/39, S24-W42/43
-
0.5
Right now on event update operation {EVENT.UPDATE.ACTION} macro can be used to get the info about what exactly has been updated during the update operation. But the value returned from it is well formatted string, for example 'acknowledged, commented and changed severity from Disaster to Average'. I think this macros was designed to use in message templates for human readable purpose.
But now, when we are developing a media-types, we need to determinate what was exactly changed to make the weebhook more flexible and avoid unnecessary operations. Current realization of such condition is using regex to determine what was updated:
if (/\bcommented/.test(params.event_update_action)) { data.additional_information = params.event_update_message; } if (/\backnowledged/.test(params.event_update_action)) { data.status.name = "acknowledged"; } if (/\bunacknowledged/.test(params.event_update_action)) { data.status.name = "new"; }
This is not the best solution because regex operations are pretty expensive and it would much better if we had a JSON formatted macro.
I would suggest to make a new macro {EVENT.UPDATE.ACTIONJSON} that would contain all the updated fields of the event. For example:
{ "newseverity": 5, "oldseverity": 3, "acknowledged": 1 }
Possible keys that could be in this JSON are the same as in {EVENT.UPDATE.ACTION}:
- oldseverity - severity that was before update
- newseverity - severity after update
- comment - update message
- acknowledged - is even acknowledged or not
- closed - is event closed or not
- causes
-
ZBXNEXT-9448 New and improved built-in macros
- Done
- mentioned in
-
Page Loading...