Auto-commit local changes before build (2026-01-16 10:01:42)
This commit is contained in:
parent
abb6780744
commit
748769afc0
@ -1 +1 @@
|
|||||||
v20260115-19-autotask-ticket-create-debug-logging
|
v20260116-01-autotask-ticket-id-normalization
|
||||||
|
|||||||
@ -451,7 +451,19 @@ class AutotaskClient:
|
|||||||
if not isinstance(ticket_id, int) or ticket_id <= 0:
|
if not isinstance(ticket_id, int) or ticket_id <= 0:
|
||||||
raise AutotaskError("Invalid Autotask ticket id.")
|
raise AutotaskError("Invalid Autotask ticket id.")
|
||||||
data = self._request("GET", f"Tickets/{ticket_id}")
|
data = self._request("GET", f"Tickets/{ticket_id}")
|
||||||
|
# Autotask commonly wraps single-entity GET results in an "item" object.
|
||||||
|
# Normalize to the entity dict so callers can access fields like "id" and
|
||||||
|
# "ticketNumber" without having to unwrap.
|
||||||
if isinstance(data, dict) and data:
|
if isinstance(data, dict) and data:
|
||||||
|
if isinstance(data.get("item"), dict) and data.get("item"):
|
||||||
|
return data["item"]
|
||||||
|
|
||||||
|
# Some endpoints/tenants may return a list even for a single ID.
|
||||||
|
if isinstance(data.get("items"), list) and data.get("items"):
|
||||||
|
first = data.get("items")[0]
|
||||||
|
if isinstance(first, dict) and first:
|
||||||
|
return first
|
||||||
|
|
||||||
return data
|
return data
|
||||||
raise AutotaskError("Autotask did not return a ticket object.")
|
raise AutotaskError("Autotask did not return a ticket object.")
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,15 @@ Changes:
|
|||||||
- Logged POST /Tickets response characteristics (status, headers, body preview) to diagnose tenants returning incomplete create responses.
|
- Logged POST /Tickets response characteristics (status, headers, body preview) to diagnose tenants returning incomplete create responses.
|
||||||
- Logged fallback Tickets/query lookup payload and result shape to pinpoint why deterministic lookup fails.
|
- Logged fallback Tickets/query lookup payload and result shape to pinpoint why deterministic lookup fails.
|
||||||
|
|
||||||
|
## v20260116-01-autotask-ticket-id-normalization
|
||||||
|
|
||||||
|
### Changes:
|
||||||
|
- Normalized Autotask GET /Tickets/{id} API responses by unwrapping the returned "item" object.
|
||||||
|
- Ensured the ticket data is returned as a flat object so existing logic can reliably read the ticket id.
|
||||||
|
- Enabled correct retrieval of the Autotask ticketNumber via a follow-up GET after ticket creation.
|
||||||
|
- Prevented false error messages where ticket creation succeeded but no ticket id was detected.
|
||||||
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
## v0.1.21
|
## v0.1.21
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user