Forums/Community/Zendesk Apps

How to view external data?

Jeff Brick
posted this on August 13, 2012 06:56

We have a custom field (ProjectCode) on our ticke and I would like to build a lotus app to retrieve and view project detail data from our database to view on the ticket per this field. Could someone please suggest what are possible ways to make the call to get our data hopefully without exposing a service publically if possible.

Any samples would be appreciated?

Thanks in advance

 

Comments

User photo
Jake Holman
Product Manager

Hey Jeff,

At the moment we only support AJAX calls with limited authentication. You can see the getting started guide to requests here: http://developer.zendesk.com/documentation/apps/requests and the more in-depth details here: http://developer.zendesk.com/documentation/apps/reference/request

I imagine you'll also want to pull that custom field value, which can be done using the ticket data object like this:

var ticket = this.ticket();
ticket.customField("custom_field_1");

Where 1 is the ID of your custom field. Learn more about ticket data: http://developer.zendesk.com/documentation/apps/reference/data

August 13, 2012 08:46
User photo
Jeff Brick

Thanks Jake,

I looked at the guide but there is no authentication help at all so just wondering what options I have as the data needs to be secure. This is a show stopper for my app and I really have no idea.


Also, i got the ticket.customField working (thanks for that) but was wondering if I can catch a changed event on that field. So if the user changes the ProjectCode I can kick off a refresh in my app.

Thanks again. 

August 13, 2012 09:07
User photo
Jake Holman
Product Manager

@Jeff: Unfortunately at the moment we have no good way of offering authentication over AJAX. It's something we'll be looking into, but it's probably some time out for now. Unfortunately the only thing you can rely on is server side checking (IP whitelisting, referral checking, shared keys, etc).

I know we have change events for most system fields, but I'll need to go and double check if change events on custom fields has been implemented yet. If not, it seems like something we should add soon.

August 13, 2012 09:11
User photo
Jake Holman
Product Manager

@Jeff: Turns out that custom_field_1.changed (where 1 is the custom field ID you need) should work. Event docs: http://developer.zendesk.com/documentation/apps/events and http://developer.zendesk.com/documentation/apps/reference/events

August 13, 2012 09:34
User photo
Jeff Brick

Had to prefix the event with ticket.

Here is the event handler that worked for the custom field. 

'ticket.custom_field_20312727.changed': function() {
     this.fetchProjectDetails();
} 

Thanks

August 13, 2012 10:21