The ticket module in Zoho Desk manages all customer support requests or inquiries. Each Ticket includes the customer's name, email, phone number, and issue. The ticket module also offers automated ticket assignment, escalation, and SLA management to help support teams streamline their workflow and efficiently support their customers.
These methods help configure the Submit Ticket form on the ASAP help widget.
The Submit Ticket form in your ASAP help widget displays the same fields configured in the ticket layout in your Zoho Desk portal. To hide any of the fields in the form, you can use the setTicketsFieldsListTobeShown() method.
You must pass this method's list of fields (apiNames) as strings. You might also have to pass the departmentId key, depending on the department mapping of the help widget. For instance, if the help widget is configured for a specific department, you don't need to pass the departmentId key. If the help widget is configured for multiple departments, you must pass the departmentId key to ensure department-ticket field mapping in the Submit Ticket form.
After you include this method, the form displays only the fields you passed.
ZDPortalSubmitTicket.setTicketsFieldsListTobeShown(ticketListTobeShown, deptId,
layoutId);
- ticketListTobeShown - List of strings (apiName of the Ticket Fields)
- departmentId - ID of the department for which you want to configure the Ticket Fields list.
- layoutId - ID of the particular layout for which you want to configure the Ticket Fields.
Please note that mandatory fields are not hidden even if you do not pass their names in the method.
If you want to hide a mandatory field in the form, you can do so, provided the field's value is pre-filled. To do this, you must use the preFillTicketFields() method.
The preFillTicketFields() method proves helpful when you want to pre-populate fields with values, such as auto-generated IDs or OS versions of devices. To use this method, you must pass the list of PreFillTicketField objects. You should also pass the departmentId key, depending on the department mapping of the add-on. Just like in the case of the setTicketsFieldsListTobeShown() method, if the add-on is configured for a specific department, you don't need to pass the departmentId key. If the add-on is configured for multiple departments, you must pass the departmentId key to ensure department field mapping.
ZDPortalSubmitTicket.preFillTicketFields(preFillTicketFields, deptId, layoutId);
- preFillTicketFields - List of PreFillTicketField objects
- deptId - ID of the department you want to configure the Ticket Fields list.
- layoutId - ID of the particular layout for which you want to configure the Ticket Fields.
The PreFillTicketField object contains three main properties:
- fieldApiName—string—the API Name of the ticket field. You can retrieve the API Name of each field using the getTicketFields() method.
- fieldValue - object
- For multi-select fields, pass the values allowed as a list of strings.
- Pass one of the values allowed as a string for pick list fields.
- For date fields, pass the value as a string in the dd-MM-yyyy format.
- For dateTime fields, pass the value as a string in the dd-MM-yyyy HH-mm format.
- For Boolean fields, pass a Boolean value.
- For all other field types, pass the values as string objects.
- Make sure that the values you pass adhere to the maxlength and decimal restrictions defined for the field.
- isEditable - Boolean - Key that defines if the value in the field is editable or not
For more details, refer to the sample code.
Submit Ticket event with a subscription
If you want your app to subscribe to the Submit Ticket event, use the following method, which includes an event callback.
- ZDPortalSubmitTicket.setCreateTicketCallback(new ZDPortalCallback.CreateTicketCallback()
{
@Override
public void onTicketCreated(Ticket ticket)
{
//Ticket created
}
@Override
public void onException(ZDPortalException e)
{
//Exception
}
});
CreateTicketCallback is the callback object that sends ticket information when a ticket is submitted via the Submit Ticket screen.
If an authenticated user submits a ticket, all its details are sent to your app. Only the ticket number is sent if a guest user submits a ticket.
Custom-Configuring Ticket actions
Users can perform various actions, including replying to, commenting, and closing tickets.
The following method helps you define which actions must be allowed and which must be disallowed when users access the ticket submission screen on the ASAP add-on.
- ZDPTicketConfiguration configuration = new ZDPTicketConfiguration.Builder()
.isReplyAllowed(true)
.isCommentAllowed(true)
.isCommentEditAllowed(true)
.isTicketUpdateAllowed(true)
.build();
ZDPortalTickets.setConfiguration(configuration);