Workaround: Adding a name field to your Help Center ticket form

46 Comentarios

  • Comentario oficial
    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':


     

     

     

  • Ali Demir

    Hi guys, I want to summarize 2 common mistakes

     

    1 - Basic Authentication

    Username: Email@email.com/token

    Password: API TOKEN

     

    2 - Custom Field from Ticket placeholder

    {{ticket.ticket_field_ID}} is not {{ticket.123456789}} but {{ticket.ticket_field_123456789}}. 

     

    So once you find your custom id from field merge it with above placeholder replacing the numeric part. 

    In my example it was like this. 

    https://subdomain.zendesk.com/api/v2/users/{{ticket.requester.id}}.json?user[name]={{ticket.ticket_field_360010332318}}

     

    Cheers. 

    1
  • Tipene Hughes
    Zendesk Developer Advocacy
    Hey Michael,
     
    This workflow uses URL targets which are still supported at this time. That said, URL targets are considered legacy and can be superseded by webhooks in most use cases. Bear in mind though that we generally advise against using targets and webhooks together with triggers and automations to update a ticket as this can lead to race conditions. You can read more about that at the link below:
     
    https://support.zendesk.com/hc/en-us/articles/4408882855578-Can-I-use-a-trigger-and-a-webhook-to-update-tickets-
     
    I hope this helps!
     
    Tipene
    1
  • 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
    Zendesk Customer Care

    Thanks for the great tip, Martijn! I think a lot of people will find this helpful!

    0
  • Jennifer Rowe
    Zendesk Documentation Team

    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:

    {{ticket.ticket_field_00000000}}
    
    

    The original post is missing the leading " ticket. ". Otherwise, I dig it! Nicely done :)

    0
  • Jennifer Rowe
    Zendesk Documentation Team

    Thanks for that correction Creighton! I've updated the Martijn's tip with the correct placeholder in the URL. 

    0
  • 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
  • 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
    Community 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
    Community 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
  • 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 ChannelsAPISettings.

    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
    Zendesk Customer Care

    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
    Zendesk Community Manager

    @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

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk