@@ -68,6 +68,8 @@ def unsplit_key(
6868def event_to_record (
6969 event : Event , rules : Sequence [Rule ], notification_uuid : str | None = None
7070) -> Record :
71+ from sentry .notifications .notification_action .utils import should_fire_workflow_actions
72+
7173 if not rules :
7274 logger .warning ("Creating record for %s that does not contain any rules!" , event )
7375
@@ -77,7 +79,7 @@ def event_to_record(
7779 identifier_key = IdentifierKey .WORKFLOW
7880 for rule in rules :
7981 rule_ids .append (int (get_key_from_rule_data (rule , "workflow_id" )))
80- elif features . has ( "organizations:workflow-engine-trigger-actions" , event .organization ):
82+ elif should_fire_workflow_actions ( event .organization ):
8183 for rule in rules :
8284 rule_ids .append (int (get_key_from_rule_data (rule , "legacy_rule_id" )))
8385 else :
@@ -166,6 +168,8 @@ def _build_digest_impl(
166168
167169
168170def get_rules_from_workflows (project : Project , workflow_ids : set [int ]) -> dict [int , Rule ]:
171+ from sentry .notifications .notification_action .utils import should_fire_workflow_actions
172+
169173 rules : dict [int , Rule ] = {}
170174 if not workflow_ids :
171175 return rules
@@ -219,14 +223,16 @@ def get_rules_from_workflows(project: Project, workflow_ids: set[int]) -> dict[i
219223
220224 assert rule .project_id == project .id , "Rule must belong to Project"
221225
222- if features . has ( "organizations:workflow-engine-trigger-actions" , project .organization ):
226+ if should_fire_workflow_actions ( project .organization ):
223227 rule .data ["actions" ][0 ]["legacy_rule_id" ] = rule .id
224228
225229 rules [workflow_id ] = rule
226230 return rules
227231
228232
229233def build_digest (project : Project , records : Sequence [Record ]) -> DigestInfo :
234+ from sentry .notifications .notification_action .utils import should_fire_workflow_actions
235+
230236 if not records :
231237 return DigestInfo ({}, {}, {})
232238
@@ -253,7 +259,7 @@ def build_digest(project: Project, records: Sequence[Record]) -> DigestInfo:
253259 group_ids = list (groups )
254260 rules = Rule .objects .in_bulk (rule_ids )
255261
256- if features . has ( "organizations:workflow-engine-trigger-actions" , project .organization ):
262+ if should_fire_workflow_actions ( project .organization ):
257263 for rule in rules .values ():
258264 rule .data ["actions" ][0 ]["legacy_rule_id" ] = rule .id
259265
0 commit comments