Pipeline notifications: Only send notifications if conditional expression evaluates to true
J
Jasmine Salamander
When configuring pipeline notifications at the pipeline/pipeline template level, Harness allows us to select filter criteria for certain notification types. E.g. for Stage Start/Stage Success/Stage Failed, we can select specific stages the notification rule applies to.
We would like to be able to get more granular than specific stage identifiers by having Harness evaluate a JEXL expression to determine whether to send a particular notification.
Using the custom notification templates feature, we can already evaluate a JEXL expression to interpolate into the body of the notification. We use this already to surface details specific to certain stage types, e.g. in a deploy stage we can surface certain attributes of the artifact, or in a custom stage running integration tests, we can surface the name of the test job.
This feature would allow us to skip sending notifications when certain fields are not available. It could also be useful for creating more generic notification rules, e.g. instead of creating many rules with different custom notification templates targeting specific stages by identifier in each pipeline, we could create a few generic rules that use a JEXL expression to decide whether they apply to a certain stage, essentially "duck typing" for notification rules.
Log In