Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagerduty_incident_workflow_trigger should not require condition value when type is conditional #961

Open
ghmj2417 opened this issue Jan 7, 2025 · 0 comments · May be fixed by #964
Open

Comments

@ghmj2417
Copy link

ghmj2417 commented Jan 7, 2025

Versions

Terraform v1.0.4
PagerDuty Provider v3.12.0

Affected Resource(s)

pagerduty_incident_workflow_trigger

Terraform Configuration Files

resource "pagerduty_incident_workflow_trigger" "stakeholders_conditional" {
  type                       = "conditional"
  workflow                   = pagerduty_incident_workflow.workflow.id
  services                   = [pagerduty_service.high_urgency.id]
  subscribed_to_all_services = false
  condition                  = ""
}

Debug Output

Error: when trigger type conditional is used, condition must be specified
with pagerduty_incident_workflow_trigger.stakeholders_conditional
on pagerduty.tf line 93, in resource "pagerduty_incident_workflow_trigger" "stakeholders_conditional":
93: resource "pagerduty_incident_workflow_trigger" "stakeholders_conditional"

Expected Behavior

Trigger should be created as 'When an incident is created' as its conditional.

Actual Behavior

Error: when trigger type conditional is used, condition must be specified

Steps to Reproduce

terraform plan

Important Factoids

When creating a trigger in the UI, you can use two options for a conditional trigger

  1. When an incident is created
  2. When conditions are met

Also, per the PagerDuty API docs it states the condition value can be null or "",

condition
string
A PCL condition string.

If specified, the trigger will execute when the condition is met on an incident.

If unspecified, the trigger will execute on incident creation.

Required if trigger_type is “conditional”, not allowed if trigger_type is “manual”.

References

I found this issue, #924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant