fix: use template instead of request_template for SD API

This commit is contained in:
Денис Кривоченко
2026-07-15 22:40:55 +07:00
parent 4df52d48f5
commit 50e9aa12e4
+1 -1
View File
@@ -176,7 +176,7 @@ async def create_ticket_in_sd(requester_email: str, subject: str, description: s
async def _send_req(email, current_city): async def _send_req(email, current_city):
req_payload = {"request": {"subject": subject, "description": html_desc, "requester": {"email_id": email}, "udf_fields": {"udf_pick_301": current_city}}} req_payload = {"request": {"subject": subject, "description": html_desc, "requester": {"email_id": email}, "udf_fields": {"udf_pick_301": current_city}}}
if template_id: if template_id:
req_payload["request"]["request_template"] = {"id": template_id} req_payload["request"]["template"] = {"id": template_id}
async with httpx.AsyncClient(verify=False) as client: async with httpx.AsyncClient(verify=False) as client:
resp = await client.post(endpoint, headers=headers, params={"input_data": json.dumps(req_payload)}, timeout=15.0) resp = await client.post(endpoint, headers=headers, params={"input_data": json.dumps(req_payload)}, timeout=15.0)
if resp.status_code not in [200, 201]: if resp.status_code not in [200, 201]: