Auto-commit local changes before build (2026-02-03 16:39:32)
This commit is contained in:
parent
04f6041fe6
commit
2667e44830
@ -1 +1 @@
|
||||
v20260203-10-autotask-resolution-field-aliases
|
||||
v20260203-11-autotask-resolution-get-put-required-fields
|
||||
|
||||
@ -605,9 +605,27 @@ class AutotaskClient:
|
||||
}
|
||||
|
||||
def _get_first(ticket_obj: Dict[str, Any], keys: list[str]) -> Any:
|
||||
"""Return first matching value for any of the given keys.
|
||||
|
||||
Autotask field casing / suffixes can vary by tenant and API surface.
|
||||
We therefore try direct lookups first and then fall back to a
|
||||
case-insensitive scan of the ticket payload keys.
|
||||
"""
|
||||
if not isinstance(ticket_obj, dict):
|
||||
return None
|
||||
|
||||
# Direct lookups (fast path)
|
||||
for k in keys:
|
||||
if k in ticket_obj:
|
||||
return ticket_obj.get(k)
|
||||
|
||||
# Case-insensitive fallback
|
||||
lower_map = {str(k).lower(): k for k in ticket_obj.keys()}
|
||||
for k in keys:
|
||||
lk = str(k).lower()
|
||||
if lk in lower_map:
|
||||
return ticket_obj.get(lower_map[lk])
|
||||
|
||||
return None
|
||||
|
||||
stabilising_fields = list(field_sources.keys())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user