How to customize the Tickets module for the ASAP Flutter SDK?

How to customize the Tickets module for the ASAP Flutter SDK?

The Ticket module in Zoho Desk manages all customer support requests and inquiries. Each ticket includes the customer's name, email address, phone number, and issue description. The Ticket module also offers automated ticket assignment, escalation, and SLA management to help support teams streamline their workflow and assist customers efficiently.

These methods help configure the Submit Ticket form on the ASAP help widget:

Custom-configuring ticket actions

Users can perform various actions, including replying to, commenting on, 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 help widget.

  1. import 'package:zohodesk_portal_ticket/zohodesk_portal_ticket.dart' show ZohodeskPortalTicket;
  2. import 'package:zohodesk_portal_ticket/data/zdp_ticket_configuration.dart' show ZDPTicketConfiguration;
  3.  
  4. void setupTicketConfiguration() {
  5.   ZDPTicketConfiguration configuration = ZDPTicketConfiguration();
  6.   configuration.isReplyAllowed = true;
  7.   ZohodeskPortalTicket.setConfiguration(configuration);
  8. }
Info
Here, 
  1. configuration.isReplyAllowed = false; disables the ticket reply option
  2. configuration.isReplyAllowed = true; enables the ticket reply option
Refer to the table below for all the ticket module configurations:

Method name
Functional description
Default status
isReplyAllowed
To hide the ticket reply option.
Enabled
isCommentAllowed
To hide the ticket comment option.
Enabled
isTicketUpdateAllowed
To hide the ticket update option.
Enabled
isCommentEditAllowed
To hide the ticket comment edit option.
Enabled
isCommentDeleteAllowed
To hide the ticket comment delete option.
Enabled
isAddTicketAllowed
To hide the add ticket option on the ticket list screen.
Enabled
isHappinessThreadAllowed
To hide the ticket happiness thread.
Enabled
isTicketPropertiesAllowed
To hide the ticket properties section.
Enabled
isTicketChannelAllowed
To hide the ticket channel icon information.
Enabled
isTicketDetailSearchAllowed
To hide the search option in the ticket detail screen.
Enabled

Customizing the Field Visibility in the Submit Ticket Form:

The ZohodeskPortalSubmitTicket.setTicketsFieldsListTobeShown() method lets you control which fields appear in the Submit Ticket form within your ASAP help widget. By specifying the required fields, you can customize the form’s layout and improve the user experience.


After you include this method, the form displays only the fields you passed.

This method takes a list of ZDVisibleTicketField objects, the object includes:

  1. The department ID (mandatory) – Ensures correct mapping of fields to the respective department.
  2. The layout ID – Specifies the layout for which the fields should be configured.
  3. A list of field API names – Defines which fields should be shown in the ticket form.
  1. import 'package:zohodesk_portal_submit_ticket/zohodesk_portal_submit_ticket.dart' show ZohodeskPortalSubmitTicket;
  2. import 'package:zohodesk_portal_submit_ticket/common/ZDVisibleTicketField.dart' show ZDVisibleTicketField;
  3.  
  4. void setTicketsFieldsListTobeShown(){
  5.   ZohodeskPortalSubmitTicket.setTicketsFieldsListTobeShown(
  6.     [
  7.       ZDVisibleTicketField(
  8.         departmentId: 'departmentId',
  9.         layoutId: 'layoutId',
  10.         fieldNames: [
  11.           "fieldApiName",
  12.         ]
  13.       )
  14.     ]
  15.   );
  16. }
Notes
Please note that the mandatory fields cannot be hidden even if you do not pass their names in the above method.

Pre-filling the ticket fields in the Submit Ticket form: 

The preFillTicketFields() method allows you to prepopulate fields in the Submit Ticket form with predefined values. This is useful for automatically setting default values, reducing manual input, and ensuring mandatory fields are filled before submission.


Additionally, this method can be used to hide mandatory fields in the form. A mandatory field can only be hidden if it has a predefined value; this ensures that even though the user doesn’t see the field, it still contains valid data required for ticket submission.

  1. Pre-filled fields with default values, such as auto-generated IDs or system data.
  2. Ensure mandatory fields have values while keeping them hidden from users.
  3. Control field editability, some fields can be locked (non-editable), while others remain user-modifiable.

Method Implementation

To pre-fill ticket fields, create a list of ZDCustomizedTicketForm objects.


Each form should include:

  • departmentId – The ID of the department where these fields should be applied.
  • layoutId – The layout ID associated with the ticket form.
  • customizedTicketFields – A list of ZDCustomizedTicketField objects, specifying the field name, value, and editability.

Each ZDCustomizedTicketField object contains three main properties:

  1. fieldAPIName (string): The API name of the ticket field. You can retrieve the API name of each field using the getTicketFields() method.
  2. fieldValue - The value assigned to the field (formatted based on field type).
  1. For multi-select fields, pass the values as a list of strings.
  2. Pass one of the values allowed as a string for pick list fields.
  3. For date fields, pass the value as a string in the dd-MM-yyyy format.
  4. For date-time fields, pass the value as a string in the dd-MM-yyyy HH-mm format.
  5. For boolean fields, pass a Boolean value.
  6. For all other field types, pass the values as string objects.
  7. Make sure that the values you pass adhere to the max length and decimal restrictions defined for the field.
  1. isEditable (Boolean) - A key that defines if the value in the field is editable or not.
  1. import 'package:zohodesk_portal_submit_ticket/zohodesk_portal_submit_ticket.dart' show ZohodeskPortalSubmitTicket;
  2. import 'package:zohodesk_portal_submit_ticket/common/ZDCustomizedTicketForm.dart' show ZDCustomizedTicketForm;
  3. import 'package:zohodesk_portal_submit_ticket/common/ZDCustomizedTicketField.dart' show ZDCustomizedTicketField;
  4.  
  5. void preFillTicketFields(){
  6.   ZohodeskPortalSubmitTicket.preFillTicketFields(
  7.     [
  8.       ZDCustomizedTicketForm(
  9.         departmentId: "departmentId",
  10.         layoutId: "layoutId",
  11.         customizedTicketFields: [
  12.           ZDCustomizedTicketField( fieldName: 'fieldApiName', value: 'fieldValue')
  13.         ],
  14.       ),
  15.     ],
  16.   );
  17. }

To fetch the Department ID for Ticket operations:

The Department ID is essential for various ticket operations, including:

  1. Pre-filling Ticket Fields – Ensuring default values are assigned.
  2. Showing Visible Ticket Fields – Controlling which fields are displayed in the ticket form.

The getDepartments() method retrieves available departments, providing the necessary Department ID for these operations.

  1. import 'package:zohodesk_portal_apikit/common/ZDResponseCallback.dart';
  2. import 'package:zohodesk_portal_apikit/model/ZDDepartment.dart';
  3. import 'package:zohodesk_portal_apikit/zohodesk_portal_apikit.dart'
  4.     show ZohodeskPortalApikit;
  5.  
  6. class DepartmentsDownloader implements DepartmentsCallback{
  7.   @override
  8.   onDepartmentsFetch(List<ZDDepartment> departments) {
  9.     //departments fetched successfully
  10.   }
  11.  
  12.   @override
  13.   onError(String errorMessage) {
  14.     //departments fetch failed
  15.   }
  16. }
  17.  
  18. void fetchDepartments(){
  19.   ZohodeskPortalApikit.getDepartments(DepartmentsDownloader());//call this method to fetch departments
  20. }

To fetch the layout for a specific Department:

The layout ID helps identify different form structures available under a department. The getLayouts() method retrieves all layouts associated with a given Department ID.

  1. Takes the Department ID as input.
  2. Returns a list of ZDLayout objects containing layout details (e.g., layout ID, name).
  3. It helps determine which layout to apply when configuring ticket fields.
  1. import 'package:zohodesk_portal_apikit/common/ZDResponseCallback.dart';
  2. import 'package:zohodesk_portal_apikit/model/ZDLayout.dart';
  3. import 'package:zohodesk_portal_apikit/zohodesk_portal_apikit.dart'
  4.     show ZohodeskPortalApikit;
  5.  
  6. class LayoutsDownloader implements LayoutsCallback{
  7.  
  8.   @override
  9.   onError(String errorMessage) {
  10.     //Failed to fetch the layouts
  11.   }
  12.  
  13.   @override
  14.   onLayoutsFetch(List<ZDLayout> layouts) {
  15.     //Layouts fetched Successfully
  16.   }
  17.  
  18. }
  19.  
  20. void fetchLayouts() {
  21.   ZohodeskPortalApikit.getLayouts("departmentId", LayoutsDownloader()); //Call this method to fetch the layouts
  22. }

To fetch the Ticket form fields for a Department and a Layout:

The getTicketForm() method retrieves the ticket form structure, including all sections and fields, for a specified Department ID and Layout ID.

  1. Takes the Department ID and Layout ID as inputs.
  2. Returns a ZDTicketForm object containing all ticket sections and fields.
  3. Helps in configuring ticket fields, ensuring mandatory fields are included, and managing form visibility.
  1. import 'dart:collection';
  2. import 'package:zohodesk_portal_apikit/model/ZDTicketForm.dart';
  3. import 'package:zohodesk_portal_apikit/zohodesk_portal_apikit.dart' show ZohodeskPortalApikit;
  4. import 'package:zohodesk_portal_apikit/common/ZDResponseCallback.dart' show TicketFormCallback;
  5.  
  6. class FormCallback implements TicketFormCallback{
  7.   @override
  8.   onError(String errorMessage) {
  9.     //Failed to Fetch the Ticket Fields
  10.   }
  11.  
  12.   @override
  13.   onTicketFormDownloaded(ZDTicketForm ticketForm) {
  14.     //Successfully fetched the Ticket Fields
  15.   }
  16. }
  17.  
  18. void fetchTicketForm(){
  19.   HashMap<String, String>  map = HashMap();
  20.   map["departmentId"] = "pass departmentId here";
  21.   map["layoutId"] = "pass layoutId here";
  22.   ZohodeskPortalApikit.getTicketForm(FormCallback(), map, null);
  23. }

To fetch Ticket fields for a Layout:

The getTicketFields() method retrieves all available ticket fields for a given Department ID and Layout ID. This enables developers to dynamically access field details, including API names, data types, and validation rules.

  1. Requires Department ID and Layout ID as inputs.
  2. Returns a ZDTicketFieldsList containing all ticket fields.
  3. Used to retrieve field metadata, which is essential for pre-filling or displaying ticket fields dynamically.
  1. import 'dart:collection';
  2. import 'package:zohodesk_portal_apikit/zohodesk_portal_apikit.dart' show ZohodeskPortalApikit;
  3. import 'package:zohodesk_portal_apikit/common/ZDResponseCallback.dart' show TicketFieldsCallback;
  4. import 'package:zohodesk_portal_apikit/model/ZDTicketFieldsList.dart' show ZDTicketFieldsList;
  5.  
  6. class FieldsCallback implements TicketFieldsCallback{
  7.   @override
  8.   onTicketFieldsDownloaded(ZDTicketFieldsList ticketFields){
  9.     //Successfully fetched the Ticket Fields
  10.   }
  11.   @override
  12.   onError(String errorMessage) {
  13.     print(errorMessage);
  14.     //Failed to Fetch the Ticket Fields
  15.   }
  16. }
  17.  
  18. void fetchTicketFields(){
  19.   HashMap<String, String>  map = HashMap();
  20.   map["departmentId"] = "pass departmentId here";
  21.   map["layoutId"] = "pass layoutId here";
  22.   ZohodeskPortalApikit.getTicketFields(FieldsCallback(), map, null);
  23. }

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform alternativeSecure Forms

                              WCAG

                                          Create. Review. Publish.

                                          Write, edit, collaborate on, and publish documents to different content management platforms.

                                          Get Started Now






                                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                Manage your brands on social media

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                                   
                                                                    

                                                                  Videos

                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    Zoho Sheet Resources

                                                                     

                                                                        Zoho Forms Resources


                                                                          Secure your business
                                                                          communication with Zoho Mail


                                                                          Mail on the move with
                                                                          Zoho Mail mobile application

                                                                            Stay on top of your schedule
                                                                            at all times


                                                                            Carry your calendar with you
                                                                            Anytime, anywhere




                                                                                  Zoho Sign Resources

                                                                                    Sign, Paperless!

                                                                                    Sign and send business documents on the go!

                                                                                    Get Started Now




                                                                                            Zoho TeamInbox Resources





                                                                                                      Zoho DataPrep Demo

                                                                                                      Get a personalized demo or POC

                                                                                                      REGISTER NOW


                                                                                                        Design. Discuss. Deliver.

                                                                                                        Create visually engaging stories with Zoho Show.

                                                                                                        Get Started Now









                                                                                                                            • Related Articles

                                                                                                                            • Working with the ASAP SDK for Flutter

                                                                                                                              This document pertains explicitly to help widgets created using the updated new ASAP Setup. If you use an older version of ASAP, the help widgets will be read-only. To enable the new ASAP widgets on your App, use the latest ASAP Flutter Plugin 2.0. ...
                                                                                                                            • Introducing ASAP Flutter Apps SDK

                                                                                                                              This document pertains explicitly to help widgets created using the updated new ASAP Setup. If you are using an older version of ASAP, the help widgets will be read-only. To enable the new ASAP widgets on your App, use the latest ASAP Flutter Plugin ...
                                                                                                                            • ASAP SDK Flutter Apps - Release Notes

                                                                                                                              2.2.2 Removed deprecated packages associated with Android v1 embedding to ensure compatibility with the latest Flutter versions. 2.2.1 Integrated the ASAP iOS SDK v4.2.0 2.2.0 Integrated the ASAP Android SDK v4.4.1 Integrated the ASAP iOS SDK v4.1.2 ...
                                                                                                                            • How to customize the Knowledge Base module for the ASAP Flutter SDK?

                                                                                                                              The Knowledge Base module enables end-users to access through help articles. These methods help you display the Knowledge Base module and all associated content in the ASAP Help Widget. Category Deep-linking The following method displays the list of ...
                                                                                                                            • How to customize the Community module for the ASAP Flutter SDK?  

                                                                                                                              The user community module enables end-users to access discussion forums and interact with other users to share knowledge and expertise. These methods help you display the Community module and all associated content on the ASAP help widget. Topic ...
                                                                                                                              Wherever you are is as good as
                                                                                                                              your workplace

                                                                                                                                Resources

                                                                                                                                Videos

                                                                                                                                Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                eBooks

                                                                                                                                Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                Webinars

                                                                                                                                Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                CRM Tips

                                                                                                                                Make the most of Zoho CRM with these useful tips.



                                                                                                                                  Zoho Show Resources