Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix building of notifications for using sum instead of reduce

Klaus Zanders37f7eb2a896b
diff --git a/lib/api/v3/notifications/property_factory.rb b/lib/api/v3/notifications/property_factory.rb
index 73b212950f0..a6331366d82 100644
--- a/lib/api/v3/notifications/property_factory.rb
+++ b/lib/api/v3/notifications/property_factory.rb
@@ -65,7 +65,7 @@ module API::V3::Notifications
def groups_for(values)
group_values = values.except(*DATE_ALERT_REASONS)
date_alert_values = values.slice(*DATE_ALERT_REASONS).values.sum
- group_values["dateAlert"] = date_alert_values if date_alert_values
+ group_values["dateAlert"] = date_alert_values if date_alert_values > 0
group_values
end