Task automation: Lookup enduser's tickets within the last x hours

Christina Dechent
Christina Dechent
  • Updated


Via our task automations, we offer a prebuilt solution to lookup a caller's open tickets within the last x hours. The number of tickets found is stored on the call session.

The search query used looks up tickets for the person who is calling and can also search for certain info added to a ticket field. 


To include this automation in your callflow, go to Integrated processes > Global automations, then click on "Add". Now choose the action "Create task via template".

In the lower section, choose the template "v1.0.0_babelforce.lookup.number.of.endusers.zendesk.tickets.in.last.x.hours".

The following required fields will appear automatically: 


Fill out the values like so:

  • body.call_id: {call.id}
  • body.zendesk_domain: enter your zendesk domain here
  • body.type: ticket
  • body.requester_id: {integration.zendesk_v2.enduser.id}
  • body.search_term: any info you'd like to lookup in any of the ticket fields
  • body.hours: enter the number of hours you want to search tickets for

This is how the process looks like: 

Storing the zendesk token:

To make this automation work, we need to carry out one more step: 

We don't want to expose the API token we use to authenticate against the zendesk endpoints. That is why we store it via our secrets API, and retrieve it via {{secret.zendesk.ticket_number_lookup}}

To store the token, there, you need to call
curl -X 'POST' \ 'https://{{env}}.babelforce.com/api/v3/tasks/configurations/secrets/zendesk' \ -H 'accept: */*' \ -H 'Authorization: Bearer i_MM***' \ -H 'Content-Type: application/json' \ -d '{ "ticket_number_lookup": "Basic YmFiZWxmb*****" }'

Was this article helpful?




Please sign in to leave a comment.