Need to trigger a new tab that opens to a predefined search

답변함

9 댓글

  • Sebastiaan (Sparkly ⭐)
    Community Moderator

    Hey Stewart,

    As far as I know that's not possible to do with the 'routeTo', you could open a new browser tab though with a link like this:
    https://{{subdomain}}.zendesk.com/agent/search/1?type=ticket&q={{your_search_query}}

    0
  • Stewart Malik

    Hi Sebastiaan,

    Thank you for your reply.

    Do you know if there are any plans to support this functionality? Our concern with using the direct link is that then their are 2 instances of Zendesk running in different tabs which voids the point of the tab interface within Zendesk.

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hi Stewart,
     
    Just to clarify, is your expected outcome to have a single new tab open with the corresponding ticket based off the searched for custom field value? Or are you expecting multiple results? 
     
    Best,
     
    Erica
    0
  • Stewart Malik

    Hi Erica,

    Multiple results, as if the user had performed the search themselves, but the action can be triggered from within a ZAF app.

    Perhaps a call like this, which opens a new tab in the Zendesk interface with the search results.

    `client.invoke('routeTo', 'search', '<search string>');`

     

    Regards,

     

    Stewart

    1
  • Erica Girges
    Zendesk Developer Advocacy
    Thanks for clarifying. Unfortunately the UI doesn't support a way to do open multiple tabs or generate search in that way. However, you could generate the search in the app via API using a search bar or form and then display the results within the app's UI. If you haven't already, I'd recommend taking a look at the Search API. Then, each search result can have the capability of being selected and open the corresponding ticket tab using routeTo (perhaps with a button click function). 
     
    Hope this helps!
     
    Best,
     
    Erica
    0
  • Sebastiaan (Sparkly ⭐)
    Community Moderator

    Don't know if this is relevant to you, but if you follow Erica's advice, you should realize that the API doesn't provide a 100% match with Zendesk's native results.

    This is especially noticeable when you search for users. When you search for 'Stew' on the API, you won't find any 'Stewarts', but you will in the native UI. You could do something like 'name:Stew*'.

    Anyway, you'll figure this out when you encounter it, but at least you know you can expect slightly different behavior.

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Great call out! Thanks for adding that. 
     
    The agent conducting the search would need to know the specific value or that wildcard would need to be applied. If the custom ticket field happens to have limited value options such as with a dropdown that could help with querying results as you can just populate in the form the same dropdown and its values as stored for that ticket field to ensure accuracy.  Definitely would need some curating overall with this approach to make sure you're getting the best results for your search needs.
    0
  • Stewart Malik

    Hi both,

    Thank you for your assistance and valuable insight!

    We've decided to implement a UI that reflects search results obtained via the REST Search API, and to then have the ticket selected automatically opened in the users Zendesk instance using the Talk Partner Edition API:

    https://developer.zendesk.com/api-reference/voice/talk-partner-edition-api/reference/#open-ticket-in-agents-browser

    0
  • Erica Girges
    Zendesk Developer Advocacy
    I like that idea! Feel free to reach back out if you hit any blockers or just in general to share your experience building it out with the Community. 😊️
     
     
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공