mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Freshdesk: fix erroring on unknown statuses by hardcoding FlightCar's.
(imported from commit 0a4b8ccaa883048fdc7a7d7712cc528194775d89)
This commit is contained in:
parent
a363b7185d
commit
30e4de6767
@ -594,14 +594,19 @@ class TicketDict(dict):
|
||||
return self.get("ticket_" + field)
|
||||
|
||||
def property_name(property, index):
|
||||
# The Freshdesk API is currently pretty broken: statuses are customizable
|
||||
# but the API will only tell you the number associated with the status, not
|
||||
# the name. While we engage the Freshdesk developers about exposing this
|
||||
# information through the API, since only FlightCar uses this integration,
|
||||
# hardcode their statuses.
|
||||
statuses = ["", "", "Open", "Pending", "Resolved", "Closed",
|
||||
"Waiting on Customer", "Waiting on Third Party"]
|
||||
"Waiting on Customer", "Job Application", "Monthly"]
|
||||
priorities = ["", "Low", "Medium", "High", "Urgent"]
|
||||
|
||||
if property == "status":
|
||||
return statuses[index]
|
||||
return statuses[index] if index < len(statuses) else str(index)
|
||||
elif property == "priority":
|
||||
return priorities[index]
|
||||
return priorities[index] if index < len(priorities) else str(index)
|
||||
else:
|
||||
raise ValueError("Unknown property")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user