From cedcbcfa2efae354e09c6808dbd0a3172495c522 Mon Sep 17 00:00:00 2001 From: Shawn Huckabay Date: Mon, 26 Feb 2024 14:25:41 -0600 Subject: [PATCH] POL-1068 Cloud Cost Anomaly Alerts Link Fix (#1864) * update * fix --- cost/cloud_cost_anomaly_alerts/CHANGELOG.md | 4 ++++ .../cloud_cost_anomaly_alerts.pt | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cost/cloud_cost_anomaly_alerts/CHANGELOG.md b/cost/cloud_cost_anomaly_alerts/CHANGELOG.md index 0ca943223d..44578c04a3 100644 --- a/cost/cloud_cost_anomaly_alerts/CHANGELOG.md +++ b/cost/cloud_cost_anomaly_alerts/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.1 + +- Fixed bug where incident link would render incorrectly if spaces were present in filter value + ## v3.0 - Link to Flexera One Cloud Cost Anomalies page now includes filters diff --git a/cost/cloud_cost_anomaly_alerts/cloud_cost_anomaly_alerts.pt b/cost/cloud_cost_anomaly_alerts/cloud_cost_anomaly_alerts.pt index 0856c2035b..df6ed4bb75 100644 --- a/cost/cloud_cost_anomaly_alerts/cloud_cost_anomaly_alerts.pt +++ b/cost/cloud_cost_anomaly_alerts/cloud_cost_anomaly_alerts.pt @@ -7,7 +7,7 @@ category "Cost" severity "high" default_frequency "daily" info( - version: "3.0", + version: "3.1", provider: "Flexera", service: "Optima", policy_set: "" @@ -394,11 +394,15 @@ script "js_filter_anomalies", type: "javascript" do filters = ds_filter_dimensions['filters'].concat(ds_filter_dimensions['bc_filters']) dimensions_groupby_string = _.map(dimensions, function(id) { - return "&groupBy=" + id + value = "&groupBy=" + id + while (value.split(' ')[1] != undefined) { value = value.replace(' ', '%20') } + return value }).join('') dimensions_filterby_string = _.map(filters, function(filter) { - return "&filterBy=anomaly." + filter['id'] + "." + filter['value'] + value = "&filterBy=anomaly." + filter['id'] + "." + filter['value'] + while (value.split(' ')[1] != undefined) { value = value.replace(' ', '%20') } + return value }).join('') link = [