Skip to content

[🐛 Bug]: Incidents do not enrich inside workflow step #6598

Description

@PaulieNor

Describe the bug

When running this workflow:

workflow:
  id: id
  name: Alert
  description: Alert
  disabled: false
  triggers:
  - type: incident
    events:
    - created
  inputs: []
  owners: []
  services: []
  consts: {}
  steps: []
  actions:
  - name: create-jira-ticket-keep-notification-board
    foreach: "{{ incident.services }}"
    if: '{{ foreach.value }} == "service"'
    provider:
      type: jira
      config: "{{ providers.Jira }}"
      with:
        board_name: Board Name
        issue_type: Task
        summary: Summary
        project_key: KE
        labels:
        - keep
        - data-notifications-{{ foreach.value }}
        description: '
          '
        enrich_incident:
        - key: ticket_url
          value: results.ticket_url

I get this error:

2026-06-24T11:53:04.808000: Running create-jira-ticket-keep-notification-board StepType.ACTION, current retry: 0
2026-06-24T11:53:04.809000: Notifying jira...
2026-06-24T11:53:04.809000: Creating an issue...
2026-06-24T11:53:05.957000: Created an issue!
2026-06-24T11:53:05.959000: Notified jira!
2026-06-24T11:53:05.959000: No fingerprint found for alert enrichment
2026-06-24T11:53:05.959000: No fingerprint found for alert enrichment
2026-06-24T11:53:05.959000: Failed to run step create-jira-ticket-keep-notification-board with error No fingerprint found for alert enrichment

However the fingerprint does exist in the workflow as it is triggered by an incident.

To Reproduce

Run a workflow created by an incident which uses a foreach loop, and inside the for_each loop try to enrich the incident.

Expected behavior

Incident should be enriched with correct information instead of erroring.

Additional context
According to Copilot, the issue is in _enrich() in base_provider.py. There is a step which is unreachable under the above conditions:

elif self.context_manager.foreach_context.get("value", {}):
    # enters here because foreach value is "customer" (truthy)
    foreach_context = ...
    if isinstance(foreach_context, AlertDto): ...       # No - it's a string
    elif isinstance(foreach_context, dict) and ...: ... # No - it's a string  
    elif self.context_manager.event_context: ...        # No - incident trigger
    else:
        fingerprint = None  # ← stuck here

# This incident_context branch is NEVER reached:
elif self.context_manager.incident_context:
    entity_type = "incident"
    fingerprint = self.context_manager.incident_context.id

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions