diff --git a/pagerduty/data_source_pagerduty_automation_actions_action_test.go b/pagerduty/data_source_pagerduty_automation_actions_action_test.go index 59110783d..d44cfdfb1 100644 --- a/pagerduty/data_source_pagerduty_automation_actions_action_test.go +++ b/pagerduty/data_source_pagerduty_automation_actions_action_test.go @@ -75,7 +75,7 @@ resource "pagerduty_automation_actions_action" "test" { process_automation_job_arguments = "-arg 1" process_automation_node_filter = "tags: production" } - only_invocable_on_unresolved_incidents: true + only_invocable_on_unresolved_incidents = true } data "pagerduty_automation_actions_action" "foo" { diff --git a/pagerduty/resource_pagerduty_automation_actions_action.go b/pagerduty/resource_pagerduty_automation_actions_action.go index b26e9fc52..2384f3860 100644 --- a/pagerduty/resource_pagerduty_automation_actions_action.go +++ b/pagerduty/resource_pagerduty_automation_actions_action.go @@ -163,6 +163,9 @@ func buildAutomationActionsActionStruct(d *schema.ResourceData) (*pagerduty.Auto automationActionsAction.OnlyInvocableOnUnresolvedIncidents = &val } + attr, _ := d.Get("only_invocable_on_unresolved_incidents").(bool) + automationActionsAction.OnlyInvocableOnUnresolvedIncidents = &attr + return &automationActionsAction, nil } @@ -310,7 +313,7 @@ func resourcePagerDutyAutomationActionsActionRead(d *schema.ResourceData, meta i } if automationActionsAction.OnlyInvocableOnUnresolvedIncidents != nil { - d.Set("only_invocable_on_unresolved_incidents", &automationActionsAction.OnlyInvocableOnUnresolvedIncidents) + d.Set("only_invocable_on_unresolved_incidents", *automationActionsAction.OnlyInvocableOnUnresolvedIncidents) } } return nil diff --git a/pagerduty/resource_pagerduty_automation_actions_action_test.go b/pagerduty/resource_pagerduty_automation_actions_action_test.go index b7f6266d7..1f681bc98 100644 --- a/pagerduty/resource_pagerduty_automation_actions_action_test.go +++ b/pagerduty/resource_pagerduty_automation_actions_action_test.go @@ -85,7 +85,7 @@ func TestAccPagerDutyAutomationActionsActionTypeProcessAutomation_Basic(t *testi resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"), resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "runner_id"), resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "runner_type", "runbook"), - resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "true"), + resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "false"), ), }, }, @@ -218,7 +218,7 @@ resource "pagerduty_automation_actions_action" "foo" { process_automation_job_id = "pa_job_id_123" process_automation_job_arguments = "-arg 1" process_automation_node_filter = "tags: production" - }, + } only_invocable_on_unresolved_incidents = "true" } `, actionName, actionName)