Skip to content

Commit

Permalink
fix(pagerduty): body is not hash
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Nov 29, 2024
1 parent b0540a9 commit a4b695c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export default function IncidentTimeline({
}

return (
<Card className="py-2 px-0" style={{ height: "calc(100vh - 430px)" }}>
<Card className="py-2 px-0" style={{ maxHeight: "calc(100vh - 430px)" }}>
<div className="flex h-full">
<div
className={`flex flex-col flex-grow transition-all duration-300 ${
Expand Down
7 changes: 6 additions & 1 deletion keep/providers/pagerduty_provider/pagerduty_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def _trigger_incident(
self,
service_id: str,
title: str,
body: dict,
body: dict | str,
requester: str,
incident_key: str | None = None,
):
Expand All @@ -440,6 +440,11 @@ def _trigger_incident(
url = f"{self.BASE_API_URL}/incidents"
headers = self.__get_headers(From=requester)

if isinstance(body, str):
body = json.loads(body)
if "details" in body and "type" not in body:
body["type"] = "incident_body"

payload = {
"incident": {
"type": "incident",
Expand Down

0 comments on commit a4b695c

Please sign in to comment.