Skip to content

Commit 366e21d

Browse files
iamrajjoshiandrewshie-sentry
authored andcommitted
🔧 chore(aci): add workflow_id to sentry app action (#89351)
1 parent 0b494d3 commit 366e21d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sentry/sentry_apps/tasks/sentry_apps.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from sentry.models.organization import Organization
2121
from sentry.models.organizationmapping import OrganizationMapping
2222
from sentry.models.project import Project
23+
from sentry.notifications.notifications.rules import get_key_from_rule_data
2324
from sentry.sentry_apps.api.serializers.app_platform_event import AppPlatformEvent
2425
from sentry.sentry_apps.metrics import (
2526
SentryAppEventType,
@@ -591,8 +592,9 @@ def notify_sentry_app(event: GroupEvent, futures: Sequence[RuleFuture]):
591592
id = f.rule.id
592593
# if we are using the new workflow engine, we need to use the legacy rule id
593594
if features.has("organizations:workflow-engine-trigger-actions", event.group.organization):
594-
id = f.rule.data.get("actions", [{}])[0].get("legacy_rule_id")
595-
assert id is not None
595+
id = get_key_from_rule_data(f.rule, "legacy_rule_id")
596+
elif features.has("organizations:workflow-engine-ui-links", event.group.organization):
597+
id = get_key_from_rule_data(f.rule, "workflow_id")
596598

597599
settings = f.kwargs.get("schema_defined_settings")
598600
if settings:

0 commit comments

Comments
 (0)