---
extractors:
  webhook_event: "{{ .JiraWebhookEvent.WebhookEvent }}"
  changed_fields: "{{range .JiraWebhookEvent.Changelog.Items}}<{{.Field}}>{{end}}"
  status_cat: "{{ .JiraWebhookEvent.Issue.Fields.Status.StatusCategory.Key }}"
  priority: "{{ .JiraWebhookEvent.Issue.Fields.Priority.Name }}"
  # MIGRATE RELATED
  alert_required: "{{ with .JiraWebhookEvent.Issue.Fields.Unknowns.customfield_10223 }}{{ .value }}{{ end }}"
  alarm: "{{ with .JiraWebhookEvent.Issue.Fields.Unknowns.customfield_10150 }}{{ .value }}{{ end }}"
  changed_to: "{{range .JiraWebhookEvent.Changelog.Items}}<{{.ToString}}>{{end}}"
routes:
  - receiver: UpgradeToL2Event
    match:
      webhook_event: jira:issue_updated
      changed_fields: <status>
      changed_to: <ESCALATE TO L2>
  - receiver: UpdateL2AssigneeEvent
    match:
      webhook_event: jira:issue_updated
      changed_fields: <L2 assignee>
  - receiver: UpdateAssigneeEvent
    match:
      webhook_event: jira:issue_updated
      changed_fields: <assignee>
  - receiver: CreatedEvent
    match:
      webhook_event: jira:issue_created