Recent searches
No recent searches
Workaround: Adding a name field to your Help Center ticket form
Posted Nov 05, 2014
We've seen multiple people struggling with the fact there isn't a out-of-the-box way to display the name field in the ticket form. Today we'd like to share the workaround which we use to meet our customers needs when we're implementing Zendesk.
The current problem with email addresses is they often don't contain the full name at all, sometimes it's even worse when your organisation is dealing with consumers because they often use nicknames in the email addresses. Now this means agents have to update the users which submit a ticket via the webform on the Help Center. To solve this issue we've created an easy to setup workaround which is using the Zendesk API and doesn't require any changes to the templates of your Help Center*. Before proceeding you need to make sure you've added a custom ticket field .
- Go to the Zendesk Admin by clicking the Admin gear icon and navigate to Extensions (under Settings).
- Press Add target and choose URL target .
-
Make sure to fill in the following values, replace the {{ticket.ticket_field_00000000}} with the custom ticket field which holds the
Name
of your user and replace {{subdomain}} with your Zendesk subdomain.
Title Update requester name
URL https:// {{subdomain}} .zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket.ticket_field_00000000}}
Method PUT
Attribute Name value
Basic Authentication Your Zendesk account - Choose Create target in the dropdown and press Submit .
- Navigate to Triggers and click A dd trigger .
-
Add the following to
Meet all of the following conditions:
Ticket: Is... Created
Ticket: Channel Is Web form -
Add the following to
Perform these actions:
Notifications: Notify target Update requester name
Message: update name - Press Create trigger
* This change could result in having two name fields on the Feedback Tab.
0
47 comments
Official
Phil Davies
I've got this working again, with the help of Eugene Orman from ZenDesk support.
For 'Basic Authentication' at the bottom of the extension, add /token to the end of your username and then use an API token:
To generate an API token, go to Admin > Channels > API
Under the Setting tab, click to enable Token Access then add a new token. Give it any label you like and then immediately copy the API token as you won't get to see it again.
NOTE: I do still get the 'HTTP client call failed' error message when testing the extension. But go ahead and save it anyway. The end result worked for me.
I also updated the trigger to include 'Current User is end user':
0
Martijn Snels • pluscloud.nl - Zendesk Premier Partner
I see the editor didn't really like what I've entered URL disappeared too.
https:// {{subdomain}} .zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket\_field\_00000000}}
0
Jessie Schutz
Thanks for the great tip, Martijn! I think a lot of people will find this helpful!
0
Jennifer Rowe
Yes, Martijn, thanks for sharing this tip! (And nice to see you! :)
0
Creighton Long
Quick update here -- the last placeholder in the URL will need to be:
The original post is missing the leading "
ticket.
". Otherwise, I dig it! Nicely done :)0
Jennifer Rowe
Thanks for that correction Creighton! I've updated the Martijn's tip with the correct placeholder in the URL.
0
Martijn Snels • pluscloud.nl - Zendesk Premier Partner
Thanks for updating the markup and placeholder. :)
0
Kevin Pollard
Thanks for posting this, however I'm getting an error. The name field is updating from the trigger/target, however it is updating to the following:
" Liquid error: undefined method `to_liquid' for #Ticket:0x007f2fb99e9748>"
rather than the custom field's name.
My URL is: https://subdomain.zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket.ticket\_field\_24317489}} . Any suggestions? (subdomain is swapped in for our actual subdomain)
0
Travis Smith
I'm also getting the error that Kevin lists:
Liquid error: undefined method `to_liquid' for #Ticket:0x007fccbda3c028>
My URL:
https://subdomain.zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket\_field\_24377455}}
(subdomain is also replaced with my actual sub domain)
I think the problem may be with the authentication? I don't want to require authentication, but I get a 401 message when I test the target without credentials. Any suggestions?
0
Creighton Long
Hi Kevin and Travis,
Looks like you're both running into the same issue -- you have included the backslash characters before the underscores in the ticket field placeholder. Remove those and you should be set!
Also, Travis, make sure you add the "
ticket."
bit in that placeholder, as I noted in my last post.I apologize for the confusion with the slashes, we had included the them in our examples in an attempt to prevent them from being processed as italic markdown. Came out a bit bit messy, I guess. I've gone back and fixed up my post now.
Hope this helps you folks get it working!
0
Travis Smith
Thanks Creighton! I'm up and running.
0
Kevin Pollard
Me as well, thanks!!!
Is there a way to only have the trigger run if it's a new requester (email address) to the system? I'd hate to overwrite an existing user's name that is correct with a partial name. For example, if I had already had Kevin Pollard set, but I created a ticket with KP, it would overwrite the person's name with KP.
0
Martijn Snels • pluscloud.nl - Zendesk Premier Partner
Hi Kevin, that's not possible at the moment without a script on an external platform which uses the API in a more advanced way. We've decided to only run this trigger on tickets which are posted by users via the webform channel.
0
Jacob the Moderator
Hi Martijn,
That's a really cool trick! Thanks for sharing!
I've tested it in my sandbox and it works for the most part, but the name doesn't update before the "Notify requester of received request" email is sent. So the first email sent to the requester will have the nickname where the full name should be shown (and will be shown in subsequent emails).
Your trigger is the very first one on the list of triggers so I would expect it to do its stuff before the "Notify requester of received request" trigger fires - any thoughts?
I'm wondering if I should make my "Notify requester of received request" trigger an automation in stead, adding a minute delay to the email, if time is the problem.
---
EDIT: Somehow I got this worked out, I forget how...as I recall the problem was only in the Sandbox.
0
Chris
Hi Martijn,
We keep getting an email which states....
"The target 'Update Requester Name' has been temporarily disabled due to too many failures. You can re-enable the target from Settings -> Extensions -> Targets to continue sending messages to the target, but please check the possible reason of these failures by testing the target first."
I've just re-tested this, using my own personal email account, and just typing in a name, and whilst the name goes into the custom Name Field, it is not updating the customers name in Zendesk.
Please help, I contacted Zendesk themselves and they are to be honest, useless. I find it incredibly frustrating that I need to use a 3rd party so that a customer can actually type their name into a contact form and update the customers name in the back end.
http://i.imgur.com/sUMGHoy.jpg
0
Jacob the Moderator
Hi Chris,
Have you tried to resubmit your basic authentication info (username/password)?
From the message on your screenshot this seems to be the issue - it can't authenticate you.
Are you using your own admin login credentials?
0
Martijn Snels • pluscloud.nl - Zendesk Premier Partner
Hi Chris, sorry for your bad experience. I think you have the issue Jacob describes. Could you check if you have Password Access enabled under Gear icon > Channels > API > Settings.
If you disabled the Password Access the alternative is to use an API Token. It's pretty easy to setup. Just press add new token copy the new token into the Password field and change the Username to the following and replace it with your own email address: yourname@yourdomain.com/token (replace yourname@yourdomain.com with your agent username and password you want to use to trigger the action from.
Hope this helps you out.
0
Chris
Hi Martijn,
I went to the COG > API > Password Access is already enabled.
We disabled SSL (because we use Host Mapping and cannot afford the higher Zendesk Plan). Does that have anything to do with it?
I also tried your second method, I created a new API Token, I used my email address/token, and put the API key into the password field, still no good.
0
Christopher McLoughlin
Hi Chris,
Disabling SSL should not cause any issues with your credentials in Zendesk.
I did take a glance at your current target and see that you do have some successful sends now. Are you still having an issue with the URL?
I know you've run into some issues getting the support you need. I want to make sure you are getting assisted on this issue so if you do still need to work on this, please let me know and we can open up a ticket to further work on this.
0
Elizabeth Toy
Just want to say thanks for this! I wish the ticket form for anonymous users asked for their name, but at least until that comes (if it comes) I have this great workaround.
In case it helps anyone else, I also rearranged the form fields with help from this post so that "name" field wasn't oddly beneath subject and description.
0
Elizabeth Toy
This has stopped working for me. :(
The trigger is running, but the target isn't. When I test the target, I continue to get the error message "Error during transmission: HTTP client call failed". I'm not sure what changed.
0
Phil Davies
Just spotted this. I'm getting the same error as Elizabeth. "Error during transmission: HTTP client call failed" I take it this no longer works?
0
Jessie Schutz
Awesome, Phil! Thanks for coming back and sharing your solution! I'm going to make it the "official" comment, so it appears at the top of the thread for others who might need it. :)
0
Loren Khulusi
We just redesigned our Help Center and added a contact form on the new requests page. We were struggling for a bit with the name field integration until coming across this article, so thank you for sharing.
More importantly, why is this not default behavior of the ticket form like it is with the web widget? Customer names are incredibly important for anybody who uses macros. Without this workaround we would not have been able to use the new requests page. Thanks!
0
Alberto Bustillos
Can something like this be achieved ?
https://{{subdomain}}.zendesk.com/api/v2/tickets/{{ticket.id}}.json?ticket.ticket_field_79996148{{ticket.ticket_field_81253208}}
It should update one ticketfield with the value of another ticketfield.
Don't know how to make the query to update a ticketfield instead of the user[name]
0
Erik Cummings
Has anyone found the resolution to the issue, when you test you get HTTP client call failed.
It seems to have to do with the {{ticket.ticket_field_ID}} place holder.
If I replace this with test like hello it works fine
Would love to get this working
0
Aswin Kannan
Can we combine 2 fields using this method, or it should be 2 different targets & triggers? I want to add a Country field in the web forms and update the user field accordingly. Thank you!
0
Brett Bowser
@Aswin you'll most likely need to set these up as 2 different targets, however, you should be able to have multiple Notify Target actions within a trigger.
Cheers!
0
Aswin Kannan
Thanks, Brett. Assuming that the Country field's ID is 12345, what is the value we should use in the place of 'name' in the example URL? Where can we find the equivalent for all other fields?
https://{{subdomain}}.zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket.ticket_field_12345}}
0
Brett Bowser
Hey Aswin,
That I'm not 100% sure about since this is an area where my knowledge is rather limited. You'd need to figure out how to call to that custom user field and populate that information from your ticket field which will be handled differently from just updated the system name field.
Apologies for not being able to provide additional information but hopefully someone else can jump in and offer up some guidance.
0