-
Bug
-
Resolution: Fixed
-
High
-
None
-
1
-
Severity 3 - Minor
-
Issue Summary
This is reproducible across all instances, and is also documented in https://github.com/opsgenie/terraform-provider-opsgenie/issues/454
Steps to Reproduce
- Call the https://api.opsgenie.com/v1/services/:serviceId/incident-rules/:incidentRuleId api with the payload detailed in the documentation on docs.opsgenie.com
{ "conditionMatchType": "match-all-conditions", "conditions": [{ "expectedValue": "Incident", "operation": "contains", "not": false, "field": "message" }], "incidentProperties": { "message": "Incident Message", "description": "Incident Description", "tags": ["Tag1", "Tag2"], "priority": "P4", "stakeholderProperties": { "enable": true, "message": "Stakeholder Message", "description": "Stakeholder Description" } } }
Expected Results
The API will perform as expected
Actual Results
The API returns a 422 error as it is expecting additional wrapping around the JSON body.
Workaround
Please place the incident rule body inside a new element incidentRule as detailed below:
{ "incidentRule": { "conditionMatchType": "match-all-conditions", "conditions": [{ "expectedValue": "Incident", "operation": "contains", "not": false, "field": "message" }], "incidentProperties": { "message": "Incident Message", "description": "Incident Description", "tags": ["Tag1", "Tag2"], "priority": "P4", "stakeholderProperties": { "enable": true, "message": "Stakeholder Message", "description": "Stakeholder Description" } } } }