Use Case - Creating an IVR Ticket Service with Zendesk

Ask caller whether they want to talk about an existing ticket or create a new ticket, open new ticket if chosen and forward caller to an agent.

In this use case, we're going to create an IVR for a helpdesk ticketing line. When a call comes in, the caller is asked to choose, whether …

  • … they want to talk to an Agent about an existing open ticket
  • … create a new ticket with an Agent

PRECONDITIONS

  • You require service owner rights to to create the Power Automate flow. You require a Power Automate "Premium" subscription to use the "Zendesk" Flow connector. The cost for flow subscriptions is determined by Microsoft and out of Luware support scope.
  • A service you have access to must be set up and ready to receive calls.
  • You have an existing Zendesk installation in your organization and you have an account to create/edit/delete data on it.
  • For Zendesk you should have an instance set up to store and look-up caller data. Please refer to Use Case - Looking up caller information from Zendesk for instructions.
 

Show Icon Legend

💡 = A hint to signal learnings, improvements or useful information in context. 🔍 = Info points out essential notes or related page in context.
☝ = Notifies you about fallacies and tricky parts that help avoid problems. 🤔 = Asks and answers common questions and troubleshooting points.
❌ = Warns you of actions with irreversible / data-destructive consequence. ✅ = Intructs you to perform a certain (prerequired) action to complete a related step.
 
 

Create the workflow IVR

✅ We want to create an IVR, asking the caller to press 1 if she wishes to speak to an agent about her open tickets or 2 if she desires to create a new ticket. We save the choice in a parameter "CreateTicket" and route all branches to the queue.

In Nimbus, access Configuration > Parameters and create a new parameter.

  • Name it "CreateTicket" for the service.
  • Set the default value to "2", which will be used later for routing to a "New Zendesk Ticket" creation.

Then create a new workflow with the name "Ticket service IVR" with the following activities:

Assign the workflow to your Nimbus service via the Service Settings.

Creating your Flow

✅ Now it's time to start your flow to read your custom parameter content and react accordingly.

  1. Start with a "GetOnUpdatedTasks" Nimbus trigger element and set the Session Event Item to "Parameter Updated".  
  2. Then add a first variable to the flow:
    1. Name UpdatedParameterName
    2. Type String
    3. Value @{triggerOutputs()?['body/UpdatedParameterName']}
  3. 💡 In between, you can optionally check if the UpdatedParameterName really is "CreateTicket" to ensure errors are handled. We omit that here.  
  4. Then add a second variable to the flow:
    1. Name CreateTicket
    2. Type String
    3. Value @{triggerOutputs()?['body/UpdatedParameterValue']}

Get Caller Information from Zendesk

✅ Now, we want to find the caller information in Zendesk.

  1. Add a Zendesk "Get items" element to the flow:
    1. Table name Users
    2. Filter query details eq '@{triggerOutputs()?['body/microsoftCallerId']}'
    3. Maximum Get Count 1  
  2. Now we need to store the information from the Zendesk "Users" table into some flow variables.  
    Add the following elements to the flow:
    1. Zendesk ID Variable
      1. Name ZendeskId
      2. Type String
      3. Value @{outputs('Get_items')?['body/value'][0]['key']}
    2. Zendesk URL Variable
      1. Name ZendeskTicketUrl
      2. Type String
      3. Value @{concat('https://yourdomain.Zendesk.com/agent/users/',variables('ZendeskId'),'/requested_tickets')}
    3. User Compose element
      1. Name ZendeskUser
      2. Inputs @{outputs('Get_items')?['body/value'][0]}  

✅ We want to switch on the CreateTicket Parameter that holds the caller's choice from the IVR.

  1. Add a switch case to the flow. 
  2. Switch on the variable previously created: @{int(variables('CreateTicket'))}.
    1. If the value is 1 then open the URL of the existing ticket.
    2. If the value is 2 then create a ticket and open the URL of the new ticket.

Your switch case should now looks as follows:

Existing ticket branch

  1. Add another Zendesk "Get Items" to the flow and set the following values:
    1. Name "Get Open Tickets"
    2. Table name Tickets
    3. Filter query status eq 'open' and requester_id eq @{variables('ZendeskId')}  
  2. Check on the length of the ticket collection returned by the "Get Items" element.
    1. In the "If yes" branch, add a "Set variable" element to the flow and set the variable "ZendeskTicketUrl" accordingly to:  
      CODE  
      @{concat('https://yourdomain.Zendesk.com/agent/tickets/', outputs('Get_Open_Tickets')?['body/value'][0]['id'])}
      💡 Only if the length is greater than 0, then there are open tickets and we want to set the URL to the most recent one, which is the first item in the collection:
    2. In the "If no" branch we simply do nothing and skip over this step.

New ticket branch

  1. Add a Zendesk "Create Item" element to the flow and set the following values:
    1. Table name Tickets
    2. type incident
    3. subject New auto ticket from Nimbus
    4. description Please fill out
    5. status open
    6. requester_id @{outputs('ZendeskUser')['id']}  
       
  2. Then add a "Set variable" element to the flow and set the variable "ZendeskTicketUrl" accordingly to:
CODE
@{concat('https://yourdomain.Zendesk.com/agent/tickets/', outputs('Create_Item')?['body/id'])}

Update the Nimbus task

  1. Add a Nimbus "UpdateTask" to the flow and set the values to:
    1. Customer.DisplayName @{outputs('ZendeskUser')['name']}
    2. Customer.Email @{outputs('ZendeskUser')['email']}
    3. Customer.CustomFields.ZendeskId = variables('ZendeskId')
    4. Customer.CustomFields.ZendeskTicketUrl = variables('ZendeskTicketUrl')

Test the flow

  1. Open Nimbus in your browser so context can open in extra tabs.
  2. Call your service and wait for the "Collect Information" activity.
  3. Choose (1) for an existing ticket and (2) for a new ticket. You should see the custom context URL open for the called agent accordingly.

Table of Contents