Creating pre-filled ticket forms

Return to top

88 Comments

  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Sam! Something like this may be specific to your IdP, however this external article shows how you can use cookies, which might work for you. I'd recommend checking with your IdP to see how that data is handled and passed back to us after login.

    1
  • Sam

    Hello Greg Katechis

    The problem does not come from our LdP.

    The problem comes from the connection url generated by Zendesk. 
    For example, on this page: 
    https://mywebsite.zendesk/hc/fr/requests/new?ticket_form_id=123456789&tf_subject=lorem%20ipsum

    the connection url generated by Zendesk will be: "/hc/fr/signin?return_to=https%3A%2F%2Fmywebsite.zendesk.com%2Fhc%2Ffr%2Frequests%2Fnew%3Fticket_form_id%3D123456789"
    The parameter "tf_subject" is not present. 

    Testing with an unknown parameter, like lorem_param=lorem ipsum, the parameter is well preserved. 
    For example, on this page: https://mywebsite.zendesk/hc/fr/requests/new?ticket_form_id=123456789&lorem_param=lorem%20ipsum
    the connection url generated by Zendesk will be : 
    "/hc/fr/signin?return_to=https%3A%2F%2Fassistance.leboncoin.info%2Fhc%2Ffr%2Frequests%2Fnew%3Florem_param%3Dlorem%2520ipsum%26ticket_form_id%3D123456789"

    Can you check why Zendesk does not generate a connection link with all the tf_ parameters?

     

    1
  • Salim Moumouni

    Is is possible to get formatting like the below?

    0
  • Remi Saumet
    Zendesk Customer Care

    Greeting Sam,

    Thank you for your reply. Hope you are doing well today !

    In order to make this work and pass multiple parameters in your URL, you will have to "encode" your URL.

    Example :

    should be encoded as :

    • https%3A%2F%2Ftest-brand42400.zendesk.com%2Fhc%2Ffr%2Frequests%2Fnew%3Ftf_subject%3Dlorem_ipsum%26ticket_form_id%3D360005678854

    I ran this test on my JWT SSO using the "return_to" parameter and this works like a charm!

    See attached gif. (right click on it and "open in new tab" to see the gif in full size)
    and

    Hope this clarifies it! Have a great rest of your day.

    Best regards,

    3
  • Salim Moumouni

    In reference to my earlier post, I'm trying to see the possibility of adding point forms and indentation/spaces in the description field. See format https://support.zendesk.com/hc/en-us/articles/4408839114522/comments/4513145611674 

    0
  • Agent Test

    Hello, I have a scenario where I couldn't get an answer about.

    Scenario : The end user is connected on the help center and wants to submit a new request. There's a field where he must enter his contract number each time he submits a request.

    Problem : How can we automatically fill the "Contract number" field for each request by an end user ( We can only get the information about the "Contract number" ticket field on the new page request from a user field called "CO" on our domain).

    Thank you !

    1
  • Jorge Moreno

    Hi, good idea, I have three things I wanted to ask/suggest:

    - Is it possible to prefill using a macro, any way to apply a macro using url?
    - If not possible, how do I go about prefilling the description field with several paragraphs and bulletpoints?
    - Any chance that you can add pre-filling functionality to ticket form settings instead? This is a good start but a bit messy for complex settings and it would be perfect to have pre filling as an action on the conditions of the form instead.

    0
  • Dane
    Zendesk Engineering
    Hi Agent Test,
     
    You will not be able to automatically fill up the Contract Number if the value resides on a user field. What you can do is utilize Ticket Update API via webhook and user triggers to automatically populate each created ticket for your users with the values from the user field. A similar method was utilized here.
     
    @Jorge,
     
    As it turns out, it's not possible to use macro with the method mentioned in this article. I'll mark this as a feedback so as to bring this to the attention of our Product Managers. I'd recommend creating a Community post separately for that with your use case to help get more visibility and votes on the idea. Then, others can share their use cases to further drive demand for that feature. 
    0
  • Julien POIROT MCC

    I have the same problem as Sam with SSO / JWT.

    Only the ticket_form_id is kept in the redirect_to field.

    Remi Saumet the return_to value is encoded by Zendesk itself  but in your demo, the return_to seems hard coded in your JWT snippet.

    In most cases, the link to the prefilled form must include dynamic data from other systems like order id.

    I think the built-in SSO function should encode all the parameters itself.

    0
  • Krishnamurthy Veeraraghavan

    Hi Kasper

    When ever customer creates the ticket and enters the subject line details at that time it need to prefix a word before the subject line. Do let me know how can we achieve this. 
    Have three ticket form and need to make this change in all these three ticket forms

     

    0
  • Asger Andersen

    Hi

    I'm facing an issue setting this up.

    When following the link in an authenticated state (ie. being logged in as help center admin) I get the following error: 

    Invalid parameter: ticket_id must be an integer from lotus_bootstrap/ticket

     

    When I try my link from an incognito/non-authenticated tab, I'm directed to the login screen instead of the filled ticket form, and if I mimic an end-user login, I get the following error:

    Request not found. You do not have access to request #0. It may have been solved or deleted.

    My link format is:

    https://wexervirtual.zendesk.com/hc/en-us/requests/new
    &tf_subject=Request to delete user account
    &tf_114103530114=Client name X
    &tf_description=I would like to request that my personal data be deleted

    0
  • Matt Taylor

    Asger Andersen there'd be a "?" after the new normally iirc.

    Example

    https://wexervirtual.zendesk.com/hc/en-us/requests/new?&tf_subject=Request to delete user account

    This isn't working though. Do you have multiple forms and can you confirm what version and theme you're on? 

    1
  • James Thurley

    For those having the same issue as Sam with `tf_*` query string parameters being removed from the `return_to` URL by Zendesk during the SSO flow, I asked the same question separately at the following URL and have also created a workaround which I've posted as a comment there:

    https://support.zendesk.com/hc/en-us/community/posts/4703281675418-Pre-filling-ticket-forms-doesn-t-work-well-with-logged-out-users-and-SSO?page=1#community_comment_4762283979034

     

    1
  • Asger Andersen

    Matt Taylor we only have one form and we are on the Professional support plan

    0
  • Matt Taylor

    Asger Andersen sorry, i should have been more specific. 

    This feature requires that your theme uses Templating API version 2. Do you know if the theme is using this version of the API?

    1
  • Asger Andersen

    Matt Taylor ah understood, no worries. I'm not sure, I'd guess we are not. Where can I see that? 

    0
  • Matt Taylor

    Asger Andersen no problem, I ran into the same issue.

    You should see something like this against the theme when editing it.

    1
  • Asger Andersen

    Matt Taylor I'm seeing the below; no mention of Template API, so maybe that's our issue

    0
  • Matt Taylor

    Is this after hitting the "edit code" option in the bottom right? If so, it may be worth speaking with the theme company.Asger Andersen

    1
  • Asger Andersen

    Thanks Matt Taylor; now I see it. We're on V1. That explains it. Thanks a lot for your help

    1
  • Federica Sapienza

    Hi,

     

    in case of values in different languages (e.g. {{dc.request_type_option_36}}), what will the value for the custom field be?

     

    Thanks

    0
  • Dave Dyson
    Zendesk Community Manager
    Hi Federica,
     
    The dynamic content variant to be shown will be based on the user's language determined by the help center: Understanding how translated content is displayed in your help center
    0
  • Adam

    Hi,

    I'm trying to find a way to pre-fill a custom field with the customers organization name.

     

    &tf_7511128378637=<???>

    Would this be the a placeholder?

    1
  • DS RF

    I had been wanting this for a long time and randomly stumbled across this article saying that it's now available, which is awesome, so thanks for adding this feature!

    However, please update the information above for Dropdown Menus (and/or Custom Fields) because this is not true:

    • Drop-down menu: Use "value" and replace spaces with underscores. For example, "dog beagle" becomes "dog_beagle".

    I don't know what else this applies to, but I could not get this to work because I was using the "value" as mentioned in the article, when it really needs to be the "tag" in the URL, which can be totally different than the value.

    In my case, I had the following:

    • value = My Account Access
    • id = 1234
    • tag = website_problem

    So attempting to use the below URL did not work:

    ?tf_1234=My_Account_Access 

    Changing the tag to "my_account_access" also didn't work because tags are forced lowercase, but my value was proper case.

    It should also be noted that a hyphen can be used to separate words, so I could have "my-account-access" as the tag, and that would have been valid.

    Finally, after paying a developer to check our code (and confirm nothing was wrong), the following worked:

    ?tf_1234=website_problem

    So the article should state for dropdown menus (and maybe other field types), that it needs to...

    • match the TAG, not the value
    • you can't simply replace spaces with underscores.  by default, this might be true, but not if you have custom tags or even if the value changed, which does not automatically modify a preexisting tag
    • tags are all lowercase

    Hopefully this helps someone else.

    2
  • Purple House

    I can get my prefilled form to take a subject line but when trying to get it to fill a custom drop down it doesn't seem to want to "take" for whatever reason.

    It just passes right over the instruction to fill the tf_[field ID]="Value_Name" - if that is indeed the correct format?

     

    I have tried both with and without the "" and neither seem to work. It does seem to "nudge" the field during the render but it quickly returns to default.

    0
  • DS RF

    Look at my comment above yours.  It's...

    tf_123=tag

    1
  • Stephen Nock

    How could I configure a form so that when an end-user completes the form, the next time they complete the form, certain values are preserved? Could a value input in a ticket form be automatically imported into a user value, and then (for a logged in user) recognize the value in the user profile and automatically pre-fill the field (or not ask the question in the form)?

    0
  • Elizabeth Cuffe

    This is a GREAT feature. My question is we are setting up the description for several forms but we don't want it to be editable. How can we do this. 

    0

Please sign in to leave a comment.

Powered by Zendesk