跳到主要内容

How do I pre-fill ticket form fields automatically for certain users? - 知识库 / Using Deskpro / Admin / Help Center - Deskpro Support

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 Help Center. 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]=2&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]=2

Assume the item ID for sales department is 2, 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 Help Center 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 ) to pre-fill other fields , use the same format our forms use to submit data. These formats can be found in your API documentation.

To find the specific IDs you need to add to the queries in the URL (like 2 for the sales department), check the configuration of this feature in your admin area. To get the ID of your sales department for example if you head to Admin > Ticket Structure > Departments and open the department you’ll see the ID in the top right:




有帮助 没有帮助

添加一条评论

请登录或注册以提交评论。

是否需要密码提醒?