when running the merge api, invalid_data api response due to merging ticket in recycle bin; but there are no tickets in the bin

when running the merge api, invalid_data api response due to merging ticket in recycle bin; but there are no tickets in the bin

Below is the error that I'm facing. I initially tested my code in sandbox and it worked great. I copied it over into production and started to catch the error. I checked the recycle bin and there were some "test" tickets that I did not know about. I removed them permanently from the recycle bin and executed my script again. Again, still getting the same API error message. I ran some debug logs to see what ticket ids were being merged. After checking many ticket ids that were showing up in the error message as deleted tickets, it turned out that the ticket ids referenced in the error message were not deleted and were very much open and active. I've tried everything to figure this out. Any help would be greatly appreciated

{"errorCode":"INVALID_DATA","message":"The data is invalid due to validation restrictions","errors":[{"fieldName":"ticketId","errorType":"invalid","errorMessage":"This is a deleted 'ticket'. You can restore the entry from the Recycle Bin of your Zoho Desk portal."}]}

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now