Since version 1.1.0 WPHelpDesk allows to define <text> and <select> custom fields. The <text> fields should be used whenever you wish to allow agent or a client to enter some text. The <select> fields can be used to allow selecting an option from a list of predefined choices, for example you can use <select> fields to assign tickets to categories or departments.
You can manage Custom Fields from wp-admin / Helpdesk / Custom Fields panel.
Creating A Custom Field
The create/edit Custom Field form has four main form fields:
- Title – this is basically “human friendly” label that helps identify field content
- Name – ideally this should be a short string consisting from lowercase A-Z letters, 0-9 digitis and “_”, “-” signs. The field names should be unique and it is a good practice to prefix field names with some string for example ticket, so when you are creating field Category the field name would be ticket_category. Once the Custom Field is saved its name cannot be changed
- Display this field in the frontend – if you want this field to be visible to user when viewing/replying to ticket in the frontend then check this checkbox.
- Type – either Text or Dropdown, if you select Dropdown following fields will appear as on the image below.
“Add Option” button allows to add new option to dropdown, clicking it will show the form with fields: Label, Value, Text Color and Background Color (as visible on the image).
Once you fill the form and click “Add” button the new option will be added to the list. From the list itself you can edit (pencil icon) and delete fields (trash icon).
Few notes about the Add Option fields:
- Label – is a text visible to users
- Value – only integers are allowed here, each field needs to have unique value. Since dropdowns data will be saved in DB by value it is best NOT to change value for this field once it is saved.
- Text Color and Text Background – allow to customize how the Label will be displayed on tickets list and/or in the frontend.
Using Custom Fields
In wp-admin panel you can display Custom Fields on Tickets list by clicking “Screen Options” tab, checking fields you want to display and clicking “Apply” button.
If you have at least one Custom Field defined then when editing a ticket, in the right sidebar new widget titled “Custom Fields” will shown as visible on the screen below. From there you can edit each custom field value.
In the frontend, fields will be visible on ticket details fields if you previously checked “Display this field in the frontend” checkbox and the field is filled for current ticket.
If you are using [[submit_ticket]] shortcode to accept new user tickets, then you can add custom fields to the submit ticket form using custom_fields parameter, for more information see [[submit_ticket]] shortcode documentation in this document.