Your observation about some ticket IDs from Freshdesk tickets not appearing in the time entries data is a valid point of inquiry. Here are a few possible explanations for why this might be happening:
Not All Tickets Have Time Entries: Time entries are usually added to tickets when someone tracks the time spent working on that ticket. If no one has logged time against a ticket, it won’t have associated time entries. This could be common for tickets that were quickly resolved or did not require detailed tracking.
Data Fetching Time Frame: The time frames for fetching tickets and time entries might not match up perfectly. For instance, if your ticket data covers the past 30 days but your time entries data fetches data from a different range or is limited due to pagination settings, this could cause discrepancies.
Filtering and Query Parameters: Ensure that the API requests for both tickets and time entries are correctly configured. Sometimes, parameters like filters or specific fields requested can affect what data you receive. Make sure there are no such filtering parameters that exclude certain tickets from the time entries dataset.
API Limitations and Pagination: Both the Tickets API and Time Entries API in Freshdesk have limitations (300 pages) on how much data can be fetched in a single request (pagination). Make sure you are handling pagination correctly, retrieving all pages of data until the end. Missed pages might result in missing data in PowerBI.
Next Steps:
Check Logs: Check the errors logs as to what is preventing fetching the complete data, if any.
Verify API Queries: Double-check your API queries for both tickets and time entries to ensure they are correctly fetching all necessary data without unintended filters.
Check for Pagination: Make sure your API requests handle pagination properly, fetching all necessary data pages.
Cross-Verify Data: Manually or using a small script, cross-verify a few ticket IDs that have no time entries to see if they truly have no time logged or if it’s an issue with data fetching.
Review API Documentation: Review the Freshdesk API documentation Freshdesk
Finally, since the List Tickets API has a limitation of only returning up to 300 pages. If you would like to export all the tickets, it’s not possible to implement via API.
You can export the details via a file manually and use this in another system to import if it supports or write a transformer on your own to comply with the format the third-party supports.
Steps to get the file export of all the tickets:
Log in to your Freshdesk account as an administrator.
Go to the “Admin” tab in the top navigation bar.
Under the “Account” section, click “Account Details”.
Click the “Export” button to initiate the export process.
Freshdesk will generate the export file and email you a download link when ready.
Check your email inbox for the export completion notification.
Follow the download link provided in the email to download the exported file. It will be in an XML file for each entity in the account zipped into one file.
Using the Freshdesk Data Export feature, you can bypass the API pagination limitations and retrieve all tickets. Remember that the export time may vary depending on the volume of all data in your account, so you might need to wait for the export to complete.