diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs b/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs
index 25de8f64bc..6241cdf60c 100644
--- a/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs
+++ b/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs
@@ -157,5 +157,34 @@ namespace Umbraco.Web.HealthCheck
.Replace("", "*")
.Replace("", "*");
}
+
+ public Dictionary> Results(StatusResultType resultType)
+ {
+ // a check is considered a success status if all checks are successful or info
+ var successResults = _results.Where(x => x.Value.Any(y => y.ResultType == StatusResultType.Success) && x.Value.All(y => y.ResultType == StatusResultType.Success || y.ResultType == StatusResultType.Info));
+
+ // a check is considered warn status if one check is warn and all others are success or info
+ var warnResults = _results.Where(x => x.Value.Any(y => y.ResultType == StatusResultType.Warning) && x.Value.All(y => y.ResultType == StatusResultType.Warning || y.ResultType == StatusResultType.Success || y.ResultType == StatusResultType.Info));
+
+ // a check is considered error status if any check is error
+ var errorResults = _results.Where(x => x.Value.Any(y => y.ResultType == StatusResultType.Error));
+
+ // a check is considered info status if all checks are info
+ var infoResults = _results.Where(x => x.Value.All(y => y.ResultType == StatusResultType.Info));
+
+ switch (resultType)
+ {
+ case StatusResultType.Success:
+ return successResults.ToDictionary(x => x.Key, x => x.Value);
+ case StatusResultType.Warning:
+ return warnResults.ToDictionary(x => x.Key, x => x.Value);
+ case StatusResultType.Error:
+ return errorResults.ToDictionary(x => x.Key, x => x.Value);
+ case StatusResultType.Info:
+ return infoResults.ToDictionary(x => x.Key, x => x.Value);
+ }
+
+ return null;
+ }
}
}
diff --git a/src/Umbraco.Web/HealthCheck/NotificationMethods/SlackNotificationMethod.cs b/src/Umbraco.Web/HealthCheck/NotificationMethods/SlackNotificationMethod.cs
index 7368a41ba0..e7afd0a16c 100644
--- a/src/Umbraco.Web/HealthCheck/NotificationMethods/SlackNotificationMethod.cs
+++ b/src/Umbraco.Web/HealthCheck/NotificationMethods/SlackNotificationMethod.cs
@@ -42,6 +42,13 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
icon = Emoji.WhiteCheckMark;
}
+ var successResults = results.Results(StatusResultType.Success);
+ var warnResults = results.Results(StatusResultType.Warning);
+ var errorResults = results.Results(StatusResultType.Error);
+ var infoResults = results.Results(StatusResultType.Info);
+
+ // todo construct Slack Message using Slack Attachments
+
var slackMessage = new SlackMessage
{
Channel = Channel,