mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Pass valid ticket type to Zendesk
The feedback endpoints use `ticket_type` to decide what to display and whether or not a ticket should be escalated. We were using the ticket_type as the value for the Zendesk ticket_type. However, the Zendesk API accepts 4 values for its ticket_type and these are different from the ticket_type values we use in our code. This change converts the Notify ticket_type value to a valid Zendesk ticket_type value when creating a Notify feedback ticket.
This commit is contained in:
@@ -130,7 +130,7 @@ def feedback(ticket_type):
|
||||
ticket = NotifySupportTicket(
|
||||
subject='Notify feedback',
|
||||
message=feedback_msg,
|
||||
ticket_type=ticket_type,
|
||||
ticket_type=get_zendesk_ticket_type(ticket_type),
|
||||
p1=out_of_hours_emergency,
|
||||
user_name=user_name,
|
||||
user_email=user_email,
|
||||
@@ -231,3 +231,14 @@ def needs_escalation(ticket_type, severe):
|
||||
not current_user.is_authenticated,
|
||||
not in_business_hours(),
|
||||
))
|
||||
|
||||
|
||||
def get_zendesk_ticket_type(ticket_type):
|
||||
# Zendesk has 4 ticket types - "problem", "incident", "task" and "question".
|
||||
# We don't want to use a Zendesk "problem" ticket type when someone reports a
|
||||
# Notify problem because they are designed to group multiple incident tickets together,
|
||||
# allowing them to be solved as a group.
|
||||
if ticket_type == PROBLEM_TICKET_TYPE:
|
||||
return NotifySupportTicket.TYPE_INCIDENT
|
||||
|
||||
return NotifySupportTicket.TYPE_QUESTION
|
||||
|
||||
Reference in New Issue
Block a user