ASAP for Mobile Platforms

Tickets

These methods help you configure the submit ticket form the way you want, on the ASAP add-on. 

Hiding Fields in the Submit Ticket Form

The Submit Ticket form in your ASAP add-on displays the same fields configured in the ticket layout in your Zoho Desk portal. If you want to hide any of the fields in the form, you can do so using the setTicketsFieldsListTobeShown() method. 

You must pass the list of fields (apiNames) as strings in this method. You might also have to pass the departmentId key, depending on the department mapping of the add-on. For instance, if the add-on is configured for a specific department, you need not pass the departmentId key. If the add-on is configured for multiple departments, you must pass the departmentId key to ensure department-ticket fields mapping in the Submit Ticket form. 

After you include this method, the form displays only the fields you passed in the method. However, keep in mind that mandatory fields will not be hidden even if you do not pass their names in the method.

Hiding Mandatory Fields in the Submit Ticket Form

If you absolutely want to hide a mandatory field in the form, you can do so, provided the value of the field is pre-filled. To do this, you must use the preFillTicketFields() method.

The preFillTicketFields() method proves useful when you want to pre-populate fields with values, such as auto-generated IDs or OS version 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 need not pass the departmentId key. If the add-on is configured for multiple departments, you must pass the departmentId key to ensure department-fields mapping. 

The PreFillTicketField object contains three main properties:
  1. fieldApiName - string - apiName of the ticket field. You can retrieve the apiName of each field using the getTicketFields() method.

  2. fieldValue - object

    • For multiselect fields, pass the values allowed, as a list of strings.

    • For pick list fields, pass one of the values allowed, as a string.

    • 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 a 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.

  3. isEditable - Boolean - Key that defines if the value in the field is editable or not

Note: For more clarity, check the sample code here.

Custom-Configuring Ticket Actions

Users can perform a range of actions, including replying to, commenting on, and closing tickets. 

The following method helps you define which actions must be allowed and which actions must be disallowed when users access the ticket submission screen on the ASAP add-on.

ZDeskTicketConfiguration ticketConfiguration = new ZDeskTicketConfiguration();
ticketConfiguration.setReplyAllowed(false);
ticketConfiguration.setTicketUpdateAllowed(false); //Ticket update will affect for Ticket close and Priority update
ticketConfiguration.setCommentAllowed(true);
ticketConfiguration.setCommentEditAllowed(false);
ticketConfiguration.setCommentDeleteAllowed(false);
MyApplication.deskInstance.setTicketConfiguration(ticketConfiguration);