diff --git a/pagerduty/event_orchestration_path.go b/pagerduty/event_orchestration_path.go index afc5a12..42bd643 100644 --- a/pagerduty/event_orchestration_path.go +++ b/pagerduty/event_orchestration_path.go @@ -59,12 +59,18 @@ type EventOrchestrationPathRuleActions struct { Annotate string `json:"annotate"` PagerdutyAutomationActions []*EventOrchestrationPathPagerdutyAutomationAction `json:"pagerduty_automation_actions"` AutomationActions []*EventOrchestrationPathAutomationAction `json:"automation_actions"` + IncidentCustomFieldUpdates []*EventOrchestrationPathIncidentCustomFieldUpdate `json:"incident_custom_field_updates"` Severity string `json:"severity"` EventAction string `json:"event_action"` Variables []*EventOrchestrationPathActionVariables `json:"variables"` Extractions []*EventOrchestrationPathActionExtractions `json:"extractions"` } +type EventOrchestrationPathIncidentCustomFieldUpdate struct { + ID string `json:"id,omitempty"` + Value string `json:"value,omitempty"` +} + type EventOrchestrationPathPagerdutyAutomationAction struct { ActionId string `json:"action_id,omitempty"` } diff --git a/pagerduty/event_orchestration_path_test.go b/pagerduty/event_orchestration_path_test.go index 6710976..096dc6e 100644 --- a/pagerduty/event_orchestration_path_test.go +++ b/pagerduty/event_orchestration_path_test.go @@ -331,6 +331,19 @@ func TestEventOrchestrationPathGlobalUpdate(t *testing.T) { ID: "4ad2c1be", Label: "business hours", }, + { + Actions: &EventOrchestrationPathRuleActions{ + IncidentCustomFieldUpdates: []*EventOrchestrationPathIncidentCustomFieldUpdate{ + { + ID: "PN1C4A2", + Value: "{{event.timestamp}}", + }, + }, + }, + Label: "Set Impact Start custom field from event", + ID: "yu3bv02m", + Conditions: []*EventOrchestrationPathRuleCondition{}, + }, }, }, { @@ -408,6 +421,19 @@ func TestEventOrchestrationPathGlobalUpdate(t *testing.T) { "conditions": [{"expression": "now in Mon,Tue,Wed,Thu,Fri 08:00:00 to 18:00:00 America/Los_Angeles"}], "id": "4ad2c1be", "label": "business hours" + }, + { + "label": "Set Impact Start custom field from event", + "id": "yu3bv02m", + "conditions": [], + "actions": { + "incident_custom_field_updates": [ + { + "id": "PN1C4A2", + "value": "{{event.timestamp}}" + } + ] + } } ] }, @@ -601,14 +627,14 @@ func TestEventOrchestrationPathUnroutedUpdate(t *testing.T) { }, }, Warnings: []*EventOrchestrationPathWarning{ - &EventOrchestrationPathWarning{ + { Feature: "variables", FeatureType: "actions", Message: "Message 1", RuleId: "abcd001", WarningType: "forbidden_feature", }, - &EventOrchestrationPathWarning{ + { Feature: "extractions", FeatureType: "actions", Message: "Message 2",