@@ -111,6 +111,26 @@ func (provider *AlertProvider) buildHTTPRequest(cfg *Config, ep *endpoint.Endpoi
111
111
resultErrors := strings .ReplaceAll (strings .Join (result .Errors , "," ), "\" " , "\\ \" " )
112
112
body = strings .ReplaceAll (body , "[RESULT_ERRORS]" , resultErrors )
113
113
url = strings .ReplaceAll (url , "[RESULT_ERRORS]" , resultErrors )
114
+
115
+ var formattedConditionResults string
116
+ if len (result .ConditionResults ) > 0 {
117
+ for index , conditionResult := range result .ConditionResults {
118
+ var prefix string
119
+ if conditionResult .Success {
120
+ prefix = "✅"
121
+ } else {
122
+ prefix = "❌"
123
+ }
124
+ formattedConditionResults += fmt .Sprintf ("%s - `%s`" , prefix , conditionResult .Condition )
125
+ if index < len (result .ConditionResults )- 1 {
126
+ formattedConditionResults += ", "
127
+ }
128
+ }
129
+ }
130
+
131
+ body = strings .ReplaceAll (body , "[RESULT_CONDITIONS]" , formattedConditionResults )
132
+ url = strings .ReplaceAll (url , "[RESULT_CONDITIONS]" , formattedConditionResults )
133
+
114
134
if resolved {
115
135
body = strings .ReplaceAll (body , "[ALERT_TRIGGERED_OR_RESOLVED]" , provider .GetAlertStatePlaceholderValue (cfg , true ))
116
136
url = strings .ReplaceAll (url , "[ALERT_TRIGGERED_OR_RESOLVED]" , provider .GetAlertStatePlaceholderValue (cfg , true ))
0 commit comments