Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/sentry/workflow_engine/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,17 @@ def get_snapshot(self) -> dict[str, Any]:
if self.triggered_actions:
triggered_actions = [action.get_snapshot() for action in self.triggered_actions]

event_id = None
if hasattr(self.event, "event_id"):
# Activity's do not have an event id
event_id = self.event.event_id

return {
"workflow_ids": workflow_ids,
"associated_detector": associated_detector,
"event": self.event,
"event_id": event_id,
"group": self.event.group,
"event_data": self.event.data,
"action_filter_conditions": action_filter_conditions,
"triggered_actions": triggered_actions,
"triggered_workflows": triggered_workflows,
Expand Down
6 changes: 3 additions & 3 deletions tests/sentry/workflow_engine/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_process_workflow_activity__no_workflows(self, mock_logger) -> None:
"associated_detector": self.detector.get_snapshot(),
"event": self.activity,
"group": self.activity.group,
"event_data": self.activity.data,
"event_id": None,
"action_filter_conditions": None,
"triggered_actions": None,
"triggered_workflows": None,
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_process_workflow_activity__workflows__no_actions(
"associated_detector": self.detector.get_snapshot(),
"event": self.activity,
"group": self.activity.group,
"event_data": self.activity.data,
"event_id": None,
"action_filter_conditions": None,
"triggered_actions": None,
"triggered_workflows": None,
Expand Down Expand Up @@ -285,7 +285,7 @@ def test_process_workflow_activity__success_logs(
"associated_detector": self.detector.get_snapshot(),
"event": self.activity,
"group": self.activity.group,
"event_data": self.activity.data,
"event_id": None,
"action_filter_conditions": [self.action_group.get_snapshot()],
"triggered_actions": [self.action.get_snapshot()],
"triggered_workflows": [self.workflow.get_snapshot()],
Expand Down
Loading