Forums/Community/Zendesk Apps

Add a simple link

Sean Kearon
posted this on September 12, 2012 10:40

In the old interface, we have some widgets that are basically just URLs to our site decorated with the ticket requester's email.  This allowed us to link to admin pages for the user when progressing the ticket.

How can this be achieved in the new interface?

 

Comments

User photo
James Rosen
Zendesk

Hi, Sean. Great question. We're working on a way to make it really easy for you to do just that. In the meantime, there are two alternatives:

  1. Add a Sidebar Icon app, which will let you open an external site in an iframe inside the agent interface
  2. Create your own app with an app.js file that just contains {} and a template that has the links you want.
September 12, 2012 11:06
User photo
Sean Kearon

Thanks James, good to hear that this will be a simple task in future :). Any idea of timescales?

In either of the options you mention above, can you still reference things like {{ticket.requester.email}}?

September 12, 2012 11:31
User photo
James Rosen
Zendesk

I don't believe Sidebar Icon apps support placeholders. The data docs have information about which fields are available to you, and the template docs can show you how to render things based on those fields.

September 12, 2012 11:37
User photo
Sean Kearon

Thanks for the links James.

September 12, 2012 11:46
User photo
Sean Kearon

Err - I mean James!  :)

September 12, 2012 13:14
User photo
Jay Rossiter

James - I have the same issue.  I've created an app to replace our old widget.  It is a simple form with a text input and a submit button that's supposed to open a new tab to our site, but something about the app framework is causing the submit URL to be appended to the Lotus URL, so it doesn't navigate away.  App 1537, if you want to look at it.

 

When I hit submit, I end up at a link looking like this:  "https://example.zendesk.com/https://admin.example.com/..." instead of "https://admin.example.com/..."

September 12, 2012 13:20
User photo
James Rosen
Zendesk

Jay: thanks for the bug report. I'm able to replicate it quite easily. I don't have an ETA for a resolution, but I'll report back when I know more.

This is unrelated, but I also noticed that you're asking for this.ticket().requester().email() in the app.activated callback. I suggest reading the note about how data is loaded asynchornously in the events documentation.

September 12, 2012 14:11
User photo
Jay Rossiter

James,

Do you have any idea when this issue might be addressed?  It's two months later, and I still can't reasonably switch to the new interface because this disrupts our workflow so badly.

December 06, 2012 15:43
User photo
Jake Holman
Product Manager

@Jay I'm going to open up a ticket on your behalf so we can track the resolution from there.

December 06, 2012 15:56
User photo
Sean Kearon

@Jake - that's great news.  Can  I track that ticket also, or will you post back here when resolved?

December 07, 2012 04:52
User photo
Jesse

Taking way too long for our time frame.

I figured this one out.  You have to combine "wait until everything loads" (https://support.zendesk.com/entries/22019977-tip-delay-app-loading-...) with a second template (or template within a template or something) to switch views after loading is complete.  All this does it stick the requester's email into the scope of the second template so that you can use it in, e.g., a link.

Honestly, I beat my head against the wall for quite awhile on this one.  I'd probably appreciate the new app structure for something complex, but this is pretty ridiculous for something as basic and useful as a contextual link.

Attached is the full zip - I basically hacked up the bookmarks example, so it still has Zendesk icons and the like.  It's very ugly but it works, though it doesn't always load reliably and you have to refresh Apps every other time or so.

January 02, 2013 14:04
User photo
Sean Kearon

Jesse - thanks for this.  But all I see after I install is the text: "here is the stupid {email} and {ticket.subject}."  Am I missing something?

January 03, 2013 01:25
User photo
Jesse

Interesting - you uploaded the entire zip file that I attached?

January 03, 2013 16:46
User photo
Sean Kearon

Yes, the whole file.  Also tried to modify the list.hdbs to fiddle with the {email} syntax, but to no avail.

January 04, 2013 01:33
User photo
James Rosen
Zendesk

Sean: Handlebars uses the "double-mustache" for interpolation. Do you maybe mean, {{email}}?

January 04, 2013 08:33
User photo
Sean Kearon

James - bingo!  That's done the trick.  I did try a few variations in the double-moustache, but hadn't tried simply {{email}}.  Thank you, and also thank you Jesse! :)

January 04, 2013 09:48