severity_based urgency results in error 2001: "Active urgency must be in high, low, or severity_based."

Dear community,

I am trying to set service “incident_urgency_rule” to “severity_based” through API (http):

{
  "service": {
"type": "service",
"name": "XXXXXX",
"description": null,
"auto_resolve_timeout": null,
"acknowledgement_timeout": null,
"status": "active",
"escalation_policy": {
  "id": "XXXXXXX",
  "type": "escalation_policy_reference"
},
"incident_urgency_rule": {
  "type": "constant",
  "urgency": "severity_based"
},
"support_hours": {
  "type": "fixed_time_per_day",
  "time_zone": "Europe/Berlin",
  "start_time": "08:00:00",
  "end_time": "18:00:00",
  "days_of_week": [
    1,
    2,
    3,
    4,
    5
  ]
},
"scheduled_actions": [],
"alert_creation": "create_alerts_and_incidents"
  }
}

And I get this error:

{
  "error": {
"message": "Invalid Input Provided",
"code": 2001,
"errors": [
  "Active urgency must be in high, low, or severity_based."
]
  }
}

This has already been discussed here in these forums (in regards to Terraform). And here in github (also related to Terraform) but it’s not a problem with the Terraform provider, it’s an API issue.

Both issues in these posts seem unresolved. We would need this feature to work. How can we get there?

Thanks and kinds regards
Daniel

Hello Daniel, I hope you’re doing well.

Thanks for reaching out on this matter.

I’ve checked the Terraform link to configuring services: https://registry.terraform.io/providers/PagerDuty/pagerduty/latest/docs/resources/service#argument-reference

It seems that the syntaxis for establishing support hours should be:

incident_urgency_rule {
type = “use_support_hours”

during_support_hours {
  type    = "constant"
  urgency = "high"
}

outside_support_hours {
  type    = "constant"
  urgency = "low"
}

}

I see that the code snippet you shared differs a bit from this one, could you check it?

If you need to continue troubleshooting the issue, I suggest you to write us down to support@pagerduty.com, this should open a case and let us work together.

If you have any other questions, please feel free to ask.

Kind regards,

Dear AgustĂ­n,

thank you for the response. We’ve done some further testing and for our scenario it worked omitting your two suggested blocks

during_support_hours

outside_support_hours

and also omitting the block

support_hours

So the end result would look like

{
    "service": {
        "type": "service",
        "name": "XXXXXX,
        "description": "null",
        "auto_resolve_timeout": "null",
        "acknowledgement_timeout": "null",
        "status": "active",
        "escalation_policy": {
            "id": "XXXXXXX",
            "type": "escalation_policy_reference"
        },
        "incident_urgency_rule": {
            "type": "constant",
            "urgency": "severity_based"
        },
        "alert_creation": "create_alerts_and_incidents"
    }
}

Solved =)

Thanks again kind regards
Daniel