Build your first Support app - Part 4: Getting data

Have more questions? Submit a request

10 Comments

  • Heather Cook

    Hi Team,



    The "data api doc" link doesn't appear to work.


    Thank you


    Heather

    0
  • Heather Cook

    Hi Team,


    I am comparing what I have to the end result code in this article and i seem to have an extra script tag in the iframe. But it doesn't seem to be effecting it. Do i need it? what is it?


     <!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
    <script type="text/javascript" src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js"></script>

    0
  • Jessie Schutz

    Hey Heather! I'm checking with our Developer Support folks to see if they can help.

    0
  • Joseph May

    Hi Heather-


    There doesn't appear to be an extra script tag in what you sent. If you have an extra open or closing tag I would suggest you remove it.

    0
  • Charles Nadeau

    Hi Heather,


    Fixed the broken link.


    Thanks.
    Charles

    0
  • Ignacio De La Llave Lorenzo

    Hello,

    I'm working in my first app in Zendesk and I have one question that I can't find in the documentation:

    Basically I want the code to react to changes in the ticket.

    For example, my app is showing a modal window when the ticket's organization has a custom field checked but I would want for that modal window to show also when the requester of the ticket (and so the organization) changes (right now you need to refresh the window to see it).

    If you could point me in the right direction on how to listen to these changes I would greatly appreciate it.

    Regards,

    0
  • Rene Herrera

    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 Flynn

    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
  • Rene Herrera

    Hi Bryan Flynn, how can i add the client.get('ticket.collaborators') function to the same code in the Part 4  of building your first support app?

    thanks

    0
  • Bryan Flynn

    Hi Rene. Where you put the code and how you process the data it returns will be up to you. The above code is just an example and isn't production ready. You'll need to customize it to meet your particular needs.

    That said, something like the below should work. You'll have to modify your own code as needed -- this is just pseudo code and an example:

    function requestUserInfo(client, id) {
    ...
    client.request(settings).then( (data) => {
    return client.get('ticket.collaborators').then((collabData) => {
    showInfo(data, collabData);
    })
    })
    ...

     

    0

Please sign in to leave a comment.

Powered by Zendesk