Can I use Freshservice API to merge tickets?

Hi.
I want to programmatically trigger an app whenever a new ticket is created. (via email only if possible)
Perform a regex match against the subject.
If a regex match is found (e.g. " #86025 " / regex “\s#\d\d\d\d\d”)
Search all non-closed and non-resolved tickets for the same match
If a match is found, merge the new ticket with the existing.

I’m very new to Freshservice development. I can see some sample code that is close here:
marketplace-sample-apps/Demo-Apps/ticket_merger at master · freshworks/marketplace-sample-apps (github.com)

Can you tell me will this work in Freshservice or Freshdesk only? I’m confused with the code samples which platform they are for?

Thanks in advance, this could save me a lot of effort.

MichaelD

Hello @dawsonweb. Welcome to the community, glad to have you here. Regarding how to decipher which platforms the sample apps are referencing you can always look at the manifest.json file. It will give you the details that you need to identify which product the app was built for.
image

The “Ticket Merger” app was built using freshdesk but I don’t see any red flags that would prevent you from tweaking this by making some changes to the manifest.json file to operate in freshservice. I would just go through the mergeWithPrimary function to make sure the api call has all the necessary fields for updating a ticket as documented in the Freshservice API guide. Since merging tickets in freshservice is simply the duplicating of ticket content into the primary ticket, closing the secondary ticket, and adding notes to both tickets, you should be able to do this via API calls.
Hope that helps some! :slight_smile:

3 Likes

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.