How to listen to ticket change

How to listen to ticket change

Hello community,
I created a widget, which checks all departments, if the user has written there as well, as some customer do this.

Overall it works fine, except that I have to refresh the widget tab every time I go to another ticket. How can I listen for that "ticket change" event? I tried App.on and ZOHODESK.Event.on, but only get the error, that both are not a function:

  1.         //Wait until SDK is loaded
  2.         ZOHODESK.extension.onload().then(function (App) {
  3.             // First loading (works)
  4.             loadTicketData();

  5.             // Here I get the error
  6.             App.on("Ticket_Changed", function (data) {
  7.                 loadTicketData();
  8.             });
  9.         });
Attached I send you the full widget file. Any help is much appreciated!
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方