Recent searches


No recent searches

Build your first Support app - Part 4: Getting data



Posted Mar 26, 2021

This is a continuing discussion about the article Build your first Support app - Part 4: Getting data in the developer documentation.


0

5

5 comments

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?

 

1


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


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.

1


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!

1


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.

Didn't find what you're looking for?

New post