Skip to content

Missing ChangeEvent for Auto-Created Incident Tasks Causes Missing Notifications #24397

@manerow

Description

@manerow

When incident tasks are automatically created (from failed test cases) and assigned to users, assignees do not receive email notifications. Manual task creation works correctly.

Root Cause:

  • Auto-created tasks use FeedRepository.create(thread) internally without generating a ChangeEvent.
  • Email notifications rely on persisted ChangeEvent entries, which are missing in this flow.
  • Similarly, when updating an existing task during Ack → Assigned transitions (patchTaskAssignee()), no ChangeEvent is created because the code path is internal and bypasses the REST response interceptor (ChangeEventHandler).

Impact:

  • Assignees of auto-created tasks do not receive email notifications.
  • Audit trail is incomplete for automated task creation and assignment changes.

Proposed Fix:

  1. Create a helper method createAndPersistThreadChangeEvent(Thread thread, String userName, EventType eventType) to explicitly generate and store THREAD_CREATED or THREAD_UPDATED events.
  2. Update createTask() to call this helper after creating a task.
  3. Update patchTaskAssignee() to call this helper after updating task assignees.
  4. Ensure REST endpoints continue using ChangeEventHandler to avoid duplicates.

Expected Outcome:

  • Email notifications sent for all automated task creations and assignment updates.
  • Audit trail complete for all incident task operations.
  • WebSocket notifications remain functional.
  • No duplicate ChangeEvents are generated.

Metadata

Metadata

Assignees

Type

Projects

Status

In Review / QA 👀

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions