Build your first Support app - Part 4: Getting data

Have more questions? Submit a request

5 Comments

  • Rene Herrera
    Comment actions Permalink

    Hi Charles Nadeau, I am following your tutorial about Build your first Support app, Part 4.

    How can I add to my app a .js code that tells me the CCs users in a ticket?

     

    0
  • Bryan - Community Manager
    Comment actions Permalink

    Hi Rene,

    Depending on what you're doing, you'll want to look at either client.get('ticket.collaborators') or the GET /api/v2/tickets/{id}/collaborators.json API. Hope this gets you going!

    0
  • Boris Yurchenko
    Comment actions Permalink

    I am trying to get two tables, one after the other. Table 1 gets info about the requester, table 2 gets info about the current agent logged in.

    My issue is that if I use two adjusted tables, one generated after the other one, the second table would replace the first one. And vice versa, basically at random.

    I created two different scripts:

    <script id="requester-template" type="text/x-handlebars-template">
    <script id="agent-template" type="text/x-handlebars-template">

    Each of them adds different information, but that gets replaced.

    Any advice would be appreciated.

    0
  • Bryan - Community Manager
    Comment actions Permalink

    Hi Boris -- without seeing your code, perhaps you are replacing a "div" with the requester's information, then immediately replacing that same "div" with agent information? OR, maybe you're not chaining/nesting the client.get JavaScript Promise calls correctly?

    If you look at this Github gist, you can see it getting requester information, then agent information, then populating a Handlebar template and displaying that information in two different tables (both tables contained in one template).

    I hope this helps. If you want to read a bit more about JavaScript Promises and how they behave in the context of Zendesk, check out this article: JavaScript Promises — a Zendesk Introduction

    Good luck!

    0
  • Boris Yurchenko
    Comment actions Permalink

    Bryan,

    The code snippet you provided made it really clear. It looks like I used a wrong approach to populating the tables. Now that I customized and extended the example code you provided I can get everything I need.

    Thanks a lot!

    0

Please sign in to leave a comment.

Powered by Zendesk