You can set up a ticket form that has pre-filled values in specific fields (such as the Subject or Description fields). This can save time for your end users and get them closer to a resolution. It also benefits your support agents by ensuring they have accurate and specific input from customers.
For example, if an article in your help center explains how to troubleshoot a coffee maker, you can create a link at the end of that article that opens a ticket form pre-populated with the coffee maker model and issue. Users who click this link will have much less information to fill out when submitting their ticket.
This article includes the following sections:
Related articles:
Configuring a pre-filled ticket form
When you create pre-filled ticket forms, you add parameters for the fields that you want to pre-fill to the URL of the form. If you have multiple ticket forms, you’ll also include the specific ticket form ID in the URL.
To configure pre-filled fields in a form
- Copy the URL for the ticket form that end users see when they click Submit a request and paste it into a text editor file.
It should resemble this, where mycompany is your subdomain: https://mycompany.zendesk.com/hc/en-us/requests/new?Note: If you have host mapping, your URL will look different from the previous example (see Host mapping - changing the URL of your help center).
- (Multiple ticket forms only) In Admin Center, click
Objects and rules in the sidebar, then select Tickets > Forms. Select the ticket form you want to pre-fill, then copy the form ID from the URL in Support and paste the ID to the end of the URL in your text editor.
-
In Admin Center, click
Objects and rules in the sidebar, then select Tickets > Fields. Copy the field values you want to pre-fill and paste them along with values to the end of the URL in your text editor.
For system values, copy the title of the field (for example "Subject"). Use the following format to paste the title at the end of the URL that you are building, along with the value that you want to assign to the field:
&tf_{title}={value}
For custom values, copy the Field ID of the field (for example, “12345”). Use the following format to paste the Field ID at the end of the URL that you are building, along with the value that you want to assign to the field:
&tf_[fieldID}={value}
- Continue adding fields and values to the end of the URL in your text editor as needed.
The parameters should be similar to the following example:
&tf_subject=Faulty charger 999 recall&tf_12345=USA
- Copy the URL from the text editor and paste it wherever you want to link end users to the pre-filled form. Your final URL should resemble one of the following examples:
- Single ticket form:
https://www.example.zendesk.com/hc/en-us/requests/new?tf_subject=Faulty charger 999 recall&tf_12345=USA
- Multiple ticket form:
https://www.example.zendesk.com/hc/en-us/requests/new?ticket_form_id=1500000300222&tf_subject=Faulty charger 999 recall&tf_12345=USA
- Single ticket form:
Parameter keys and values
The URL parameter keys and values differ based on what type of field you want to pre-fill. There are two different field types that are used in a request ticket form:
-
System fields - are the default fields in a ticket and have a unique name.
-
Custom fields - are fields that you can create to supplement the information that is already being gathered from the existing system fields.
System fields
The URL parameter of system fields uses the prefix tf_
followed by the field name. For example tf_subject
. For more information, see System ticket fields. Use the following parameters for the Zendesk system fields:
-
Email:
tf_anonymous_requester_email
-
Priority: Include the value type (low, norm, high, urgent), after the field name, for example
tf_priority=high
-
Type: Include the value type after the field name, for example
tf_type=incident
-
Description:
tf_description
-
Subject:
tf_subject
-
Due date: (Used when Type=task) Use the canonical date format YYYY-MM-DD, for example
tf_due_at
-
Cc: (Used when a user is logged in). Separate the emails with a comma, not a space, for example
tf_collaborators=name1@example.com,name2@example.com
-
Organization ID: Include the value type after the field name, for example
tf_organization_id=123456789
Custom fields
The URL parameter of custom fields uses the prefix tf_
followed by the field ID. For example tf_40630945
. For more information, see About custom field types. With custom objects, you can create the following custom fields:
- Multi-select: Use field tags as the values and separate them with a comma, not a space, for example blue,green,red.
-
Drop-down menu: Use the tag associated with the value. For example
tf_40630945=dog_beagle
. - Checkbox: Use the value true/false
- Decimal: Use integers and non-integers (for example, -8.012345679). Do not use commas.
- Date: Use the canonical date format: YYYY-MM-DD
-
Lookup relationship: Use the value or custom object record ID. For example:
tf_40630945=HVAC02345
Using pre-filled ticket forms with SSO authentication
When you use pre-filled ticket forms in environments with single sign on (SSO) authentication, end users must be logged in before they can submit a ticket. This means that if an end user accesses the pre-filled ticket form from another source (for example, website or QR code), they must be logged in to see the initial values in the pre-filled ticket form. If they are not logged in, they will be prompted to log in before being directed to the ticket form. Because users are accessing the form from the login page rather than from the original link or QR code, the pre-filled ticket values no longer appear. Users can still fill out the form and submit the ticket, but they will not see any pre-filled values.
To ensure that users can access pre-filled ticket forms at all times, you can choose to not require user authentication prior to access the ticket form. Alternatively if your environment requires user authenticaion in all cases, you can include content for users wherever they access the link, instructing them to return to this link after they log in to the environment. Once they are logged in, they can click the link or use the QR code to access the pre-filled ticket forms.
122 comments
Simon Blouner (midlertidig)
1
Kasper Sørensen
Hi @...
Thanks for raising this issue. The new feature is only available when your theme is using Templating API v2. Is your custom theme perhaps using Templating API v1?
0
Simon Blouner (midlertidig)
Hey @...
Thanks for the quick reply!
I can confirm my theme is built on the API v2 - but for good measure, this should probably be added to this article as a heads-up :-)
0
Kasper Sørensen
Working on that :)
0
Nova Dawn
Thanks for raising this Simon Blouner, it's a good addition to the documentation.
0
Matt Heroux
Can we pass through text field or numeric values as well? or just the field types listed above?
0
Kasper Sørensen
@... absolutely! I think this article only wanted to specify the required format for field types where the format is non-trivial. For text and numbers, you just pass in the text or the number :-) Like:
0
Bruce Sattler
Hi Team,
I love this feature! Question: will this also work with conditional fields which are not visible yet when the form is opened?
Thanks!
Bruce
2
Kasper Sørensen
Hi @...,
Yes it also works with conditional fields, even if they're not shown initially.
1
小林正左子
That's a great feature!
I wonder if the parameter keys and values are retained when the ticket form is reloaded?
0
Juraj Jarmek
Hello Xiǎolín,
As long as the URL string is kept, if the page is reloaded, the values will be kept.
Hope that helps!
1
Hussain Mithaiwala
Hello!
This feature is really good.
Firstly, can this be used if there is only 1 form? meaning I don't need to put in the ticket form ID.
hc/en-us/requests/new?tf_1260812645989=
I just want to get an idea on the dropdown values, it says to use option and value
If I have a dropdown with 2 values
VALUE = ABC, TAG = ABC_TEST
VALUE = XYZ, TAG = XYZ_TEST
What would the url be for such a case using the one I pasted above.
Appreciate your help.
Hussain
0
Kasper Sørensen
Hi @...,
The parameter value in this case would be the option value's tag. If it's a multi-select field you can comma-separate those tags as well. So in your case it seems it would be:
0
Hussain Mithaiwala
Hi Kasper
Thank you for your reply.
I did try it the same way you have written, however didn't work.
I will try it again and will update if successful.
Regards
Hussain
0
Darren
Hi,
Do you need a rich text editor or can you just use for example word pad?
I am not a developer but this seems easy enough to implement.
Thank you!
0
Juraj Jarmek
Hello @...,
Please note that Word Pad is indeed a rich text editor.
You could also use Google Docs or Microsoft Word Online from your Microsoft account, if you have one.
Hope that answers it!
0
小林正左子
Hello.
For example, if there is a submission error in a ticket form, does the re-displayed ticket form retain the value of the parameter before the error occurred?
0
Kasper Sørensen
If form submission fails, we try to retain the values at the time of submitting, not the pre-filled values in the URL. Because the user could have changed the pre-filled values.
0
Mike Martello
@... I wrote some custom code for our help center literally the evening before seeing this article. While it was a waste of my own time (lol/sob) it may be helpful for you or anyone not using v2 of the help center.
DISCLAIMER: I am more of a JavaScript/jQuery hobbyist than a developer, so use at your own risk. :)
Adding the below snippet will allow you to pre-fill fields using links like this:
https://example.zendesk.com/hc/en-us/requests/new?ticket_form_id=123&fields=request_custom_fields_456,tag1|request_custom_fields_789,tag2
Just swap 123 for your form ID, 456 and 789 for your custom ticket field IDs you want filled out, and tag1 and tag2 for the tags associated with the options you want selected for those fields. This format should work for any number of fields you wish to add, whether it's one or 10.
I wrote this specifically for drop-down custom fields, but you could likely adapt the script for other field types.
Anyways, here's the script you'd want to add to your new_request_page.hbs template:
For those new to jQuery, you should also make sure your page is set up to utilize jQuery by adding something like this:
3
Matt Heroux
Question about URL retention - if a user navigates around the HC before going back to the form, it looks like we lose the passthrough string - is this something you plan on addressing?
0
Kasper Sørensen
Hi @...
This is intentional. Pre-filled values based on URL parameters are specifically only in effect when those URL parameters are set. That way you can have different links pointing at the same form, pre-filling it in different ways.
0
Garrett Galindo
Hello,
I am trying to get this rolling and it seems like it's not possible if only one form is in use. My Help center only allows submissions at the following URL with no form ID.
Do we need to upgrade our account in order to utilize such a simple feature?
zendesk.com/hc/en-us/requests/new
0
Yijun Wang
Hello,
When pre-filling the forms with user information in GET request params, is there any recommended practices?
Is there risk in user information being leaked via parameters stored in server access logs? How does Zendesk handle server access logs in this case?
Thanks!
0
Kasper Sørensen
Hi @...
No upgrade is needed. You just modify your links. For example, here's a link to your form where it says Hello Garrett in the subject :-)
0
Kasper Sørensen
Hi @...
I would not recommend filling in any PII (personally identifiable information) into any URL. Simply because it's easy to copy-paste that URL and accidentally have your users accidentally leak the information that way. Side-note also that my gut reaction would be that it is better for you to store such information in the user object instead of the ticket, but of course use cases differ here.
As for our logs, please refer to our data deletion policy.
0
Alejandro Colon
@... Is there any way to include a new line? Specifically, in the description field. I tried the following with no success:
1
Kasper Sørensen
Hey Alejandro, yes so it depends on whether or not you use a rich text editor or a plain text editor for the description field. If you use rich text, you should provide the HTML <br> tag, so you could have a parameter like
1
Alejandro Colon
@...
Thank you so much. I didn't even think of that even though I came up with a convoluted way of building the HTML paragraphs in the link. That is so much easier and makes more sense.
I think this would be a great thing to add to the article as I believe many people would like the ability to add new lines to the pre-filled ticket forms.
1
Dmitry Kozhanov
Hi guys,
Thank you for the great feature.
But for some reason, it doesn't work for our case.
https://support.informationmapping.com/hc/en-us/requests/new?tf_subject=test
Could you help me?
Thanks!
0
Kasper Sørensen
Hi @...
If I disable javascript on your site, then it works. So I don't know what specifically, but it seems your theme customization is doing something here which clears the form or gets in the way of our logic populating the form.
0