Try it free

Send problem as event to PagerDuty workflow template

  • Latest Dynatrace
  • Reference
  • 4-min read
  • Published Sep 28, 2026

The PagerDuty PagerDuty Connector supports problem detection and alerting and notification use cases.

To alert on Dynatrace problems in PagerDuty, use the ready-made workflow template Send problem as event to PagerDuty. This is a good starting point for fine-tuning the custom notifications and for the heavy lifting of adapting the Davis problem data structure to the technical representation of the PagerDuty Events API V2.

Send problem as event to PagerDuty workflow template details

The Send problem as event to PagerDuty workflow template combines a simple workflow, its problem trigger, and the mappings for each input field of the Send event action.

To find and create this simple workflow from the template, follow the steps in the workflow template page.

Problem trigger

The template configures the problem trigger to not notify on problems with a Minimum duration less than 5 minutes, while still triggering the workflow for almost every event type.

The trigger uses the following values:

  • Event state uses active and closed. The same workflow can trigger and resolve alerts.
  • Event category includes every category except Info.
  • Severity uses Minor (3).
  • Affected entities uses the include all entities option.
  • In the Advanced options section:
    • Minimum duration uses 5 minutes to avoid alerting for short-lived problems.
    • The template doesn't consider Updates and leaves this field empty.
    • Initial root cause analysis turns on Wait for root cause analysis, so the workflow waits for root cause analysis to finish before alerting. This setting improves the data quality of the alerts.
    • Additional custom filter stays empty, but this is where you can add custom filtering, if necessary.

PagerDuty Send event action

The PagerDuty Send event action triggers, acknowledges, and resolves PagerDuty alerts automatically based on events.

The action uses Jinja expressions for workflows to populate the input fields with dynamic Davis problem data.

The action uses the following values:

  • Connection: Select one of the preconfigured connections to PagerDuty Events that you created during the setup.

  • Summary: This mapping uses the problem title or a default generic value.

    {{ event()["event.name"] | default("Dynatrace Problem") }}
  • Timestamp: This selects the correct timestamp based on the problem status.

    {% set timeOfEvent = "" %}
    {% set status = event().get("event.status") %}
    {% if status == "ACTIVE" and event().get("event.start") %}
    {% set timeOfEvent = event()["event.start"] %}
    {% elif status == "CLOSED" and event().get("event.end") %}
    {% set timeOfEvent = event()["event.end"] %}
    {% elif event().get("timestamp") %}
    {% set timeOfEvent = event()["timestamp"] %}
    {% endif %}
    {{ timeOfEvent }}
  • Severity: A mapping translates Dynatrace problem severity to PagerDuty. One of critical, error, warning, or info. A default value of warning is assumed.

    {% set severity_mapping = {
    "1": "critical",
    "2": "error",
    "3": "error",
    "4": "warning",
    "5": "info"
    }
    %}
    {% set severity = event().get("event.severity") %}
    {{ severity_mapping.get(severity | string | trim, "warning") }}
  • Source: The mapping lists the host names, or the affected entities if no hosts are set.

    {% set source = "" %}
    {% if event().get("host.name") and event()["host.name"] | length >= 1 %}
    {% set source = event()["host.name"] | join(", ") %}
    {% elif event().get("smartscape.affected_entities") and event()["smartscape.affected_entities"] | length >= 1 %}
    {% set source = event()["smartscape.affected_entities"] | map(attribute="name") | join(", ") %}
    {% endif %}
    {{ source }}
  • Component: The mapping uses the root-cause entity's name, or the affected entities' names if none is available.

    {% set entity = "" %}
    {% if event().get("root_cause.smartscape_entity") %}
    {% set entity = event()["root_cause.smartscape_entity"]["name"] | default("") %}
    {% elif event().get("smartscape.affected_entities") and event()["smartscape.affected_entities"] | length >= 1 %}
    {% set entity = event()["smartscape.affected_entities"] | map(attribute="name") | join(", ") %}
    {% endif %}
    {{ entity }}
  • Group: The template leaves this field empty.

  • Class: The field uses the problem category.

    {{ event()["event.category"] | default("") }}
  • Deduplication key: The ID that PagerDuty uses for deduplication: the Dynatrace environment ID and the problem display ID.

    {{ environment()['id']}}: {{ event()["display_id"] | default("") }}
  • Event action: ACTIVE problems trigger new alerts, whereas CLOSED problems resolve alerts.

    {% set action = "unknown" %}
    {% set status = event().get("event.status") %}
    {% if status == "ACTIVE" %}
    {% set action = "trigger" %}
    {% elif status == "CLOSED" %}
    {% set action = "resolve" %}
    {% endif %}
    {{ action }}
  • Client: This field includes the Dynatrace environment name.

    Dynatrace ({{ environment()['id'] }})
  • Client URL: The Dynatrace environment URL is included.

    {{ environment()['url'] }}
  • Custom details: This field adds important problem metadata: the number of affected users, the impact levels, the problem category, and the names as well as the IDs of the root cause entity, the affected entities, and the related entities.

    {% set rce = event().get("root_cause.smartscape_entity") %}
    {% set root_cause = (rce.name ~ " (" ~ rce.id ~ ")") if rce else "" %}
    {% set aes = event().get("smartscape.affected_entities") %}
    {% if aes is sequence and aes is not string %}
    {% set affected_entities = [] %}
    {% for ae in aes %}
    {% set _ = affected_entities.append(ae.name ~ " (" ~ ae.id ~ ")") %}
    {% endfor %}
    {% endif %}
    {% set res = event().get("smartscape.related_entities") %}
    {% if res is sequence and res is not string %}
    {% set related_entities = [] %}
    {% for re in res %}
    {% set _ = related_entities.append(re.name ~ " (" ~ re.id ~ ")") %}
    {% endfor %}
    {% endif %}
    {
    "affected_users_count": {{ event()['dt.davis.affected_users_count'] | default('0') }},
    "impact_level": "{{ event()['dt.davis.impact_level'] | default([]) | join(', ') }}",
    "problem_category": "{{ event()['event.category'] | default('') }}",
    "severity": {{ event()['event.severity'] | default('4') }},
    "root_cause_entity": "{{ root_cause }}",
    "affected_entities": "{{ affected_entities | join(', ') }}",
    "related_entities": "{{ related_entities | join(', ') }}"
    }
  • Links URL: The link to the problem in Dynatrace.

    {{ problem_link() }}
  • Links URL: The link to the workflow in Dynatrace that sent the event is included.

    {{ execution()["workflow"]["link"] }}
  • Images: The template leaves this field empty.

Related topics

  • PagerDuty Connector
  • Set up PagerDuty Connector
  • Actions for PagerDuty Connector
Related tags
Dynatrace Platform