In this article, we describe how to sync ticket status in Exalate for Freshdesk.
In Freshdesk, the status field is represented by numeric IDs rather than names. When integrating or syncing data, it is important to map the status field using these numeric IDs instead of the status names (e.g., Open, Pending, Resolved, Closed). To retrieve the status IDs, use the List All Ticket Fields API endpoint:
GET https://<your-domain>.freshdesk.com/api/v2/ticket_fields
This API call will return a list of all ticket fields, including the status field and its available values with their corresponding IDs. These IDs should be used for accurate synchronization between Freshdesk and other platforms, such as Jira.
To configure mapping to sync statuses in Freshdesk, use the following rules:
From Freshdesk to Jira
Freshdesk Outgoing Sync Rules:
replica.status = entity.status
Jira Incoming Sync Rules:
// Map Freshdesk status ids to Jira status names
def statusMap = [
"2" : "Backlog",
"3" : "In progress",
"4" : "Done"
]
def remoteStatusName = replica.status.name
issue.setStatus(statusMap[remoteStatusName] ?: "Open")
In case the Freshdesk ticket status is not provided in the map, the status in Jira will default to the fallback value specified (e.g., "Open" in the code example above).
From Jira to Freshdesk
Jira Outgoing Sync Rules:
replica.status = issue.status
Freshdesk Incoming Sync Rules:
// Map Jira status names to Freshdesk status names
def statusMap = [
"Backlog" : "Open",
"In progress" : "Open",
"Done" : "Resolved"
]
entity.status = nodeHelper.getStatus(statusMapping[replica.status?.name] ?: "Open")
In case the Jira issue status is not provided in the map, the status in Freshdesk will default to the fallback value specified (e.g., "Open" in the code example above).
Have more questions? Ask the community