How do I pre-fill ticket form fields automatically for certain users?

Sometimes you might want to pre-fill the ticket form fields in the contact page on your helpdesk portal. It's quite common that you already know users on specific parts of your site are looking to submit tickets of a particular nature.

For example, they might be on looking for sales information about a particular product you sell. So you'd want to create a link to a ticket form that pre-fills the department as 'Sales', and the custom field for product to 'Product X', with a ticket subject that reflects the nature of the request.



How can this be done?

To achieve this, Deskpro provides a feature that allows you to send this data using a specific URL. For example:

http://EXAMPLE.COM/new-ticket?ticket[department]=7&ticket[ticket_field_8][data]=9&ticket[subject]=Purchasing%20Product%20X

As you can see, The URL is split up into the following:

http://EXAMPLE.COM/new-ticket?

This is the URL that takes the user to a new ticket form

ticket[department]=7

Assume the item ID for sales department is 7, so this part of the URL determines that the department field will be pre-filled with item ID 7, which is sales.

&ticket[ticket_field_8[data]=9

Also assume the custom field ID for product is 8, and Product X is ID 9. This means the URL pre-fills the custom field for product, which has the ID 8, with the item ID 9, which is Product X.

&ticket[subject]=Purchasing%20Product%20X

This URL also pre-fills the subject line with 'Purchasing Product X'. The %20 is the URL code for a space.

If the user is logged into Deskpro, it will automatically fill their name and email by default.

&ticket[message][message]=ABC

This can be used to pre-fill the message field.


How can I use this for my own helpdesk?

Using this method, users who click the URL will be taken to the new ticket form on your user portal where each field will be pre-filled with whatever you specify in the URL.

To create a URL that pre-fills tickets with different data, simply change the query parameters and item IDs.

If you want to change the query parameters (like ticket[department]) to pre-fill other fields , use the same format our forms use to submit data. These formats can be found in your API documentation at https://YOURHELPDESKURL/api/v2/doc#post--api-v2-tickets.

To find the specific IDs you need to add to the queries in the URL (like 7 for the sales department), you can also find a guide to displaying item IDs here.

Helpful Unhelpful

3 of 4 people found this page helpful

Add a comment

You need to log in before you can submit a comment.

Need a password reminder?