Skip to main content

Hi,

is there anyone who knows how to exclude merged tickets from get tickets api call?

My current api call is the following one:

GET “https://domain.freshdesk.com/api/v2/tickets?updated_since=2021-01-01T00:00:00Z&page=1&per_page=100&include=stats,requester,company,description

The ouput of this call will give me also merged tickets.
I saw that the “affected_area” info most of the time is set to “Merget Ticket”, but not for all of the tickets and I did not find any other possible info about the merging.

Does anyone has experience with that?
Thanks a lot

Hi Alessandro,

 

Greetings from the Freshworks community!

 

At the moment, We would not be able to differentiate the merged tickets via API directly since we do not have a unique identifier for the same. However, as a workaround, you could create a Ticket update rule (Automations) to achieve this. Using automation, we can make the merged secondary tickets unique and identify the same in the 'view ticket API.' Sharing the steps below the achieve the same.

 

1. Create a custom dropdown field - 'Merged' under Admin > ticket fields.  We can use this field to mark the merged secondary tickets. 

1yUhTI8rJcwx7iExI4xYWNKbOJYdpxBNNhvqwQDW1DYqh8SHQ-hfIuNtbFlRmsqkimxbZx75se5F_vGntto6pdsrscGqbg46C7FccREPspxyxMXOQ9lcT8sCguai_a_khAAUZdv6Sonrjre0vHT8jg

2. Create an automation rule under Admin > Ticket updates that will trigger whenever a ticket is merged and mark this field as yes in ticket properties.

 

JudIJ-jpSoCKfBDRxmSoDeyX-eaOXMV-ArRLhsYzUHLV1YqWggDoFaSCWWlD4zEN9hAx7ykQ9OGD474TMwOuvE7zxAG-W82P-dURQq49w4wcHtusjVDAD5o6OW7aN1DkbT7NaRqnZQX-YkcsmGtI4Q

 

Now, when you view a ticket via API, you can see the field 'Merged' with the value 'yes' for merged tickets and null for primary tickets. Feel free to drop a note here incase of further queries on this front.

 

Cheers

Aishvarya


Hi Aishvarya,

thanks for your reply.

This will work for all new tickets, is that right?

My real big problem is that there are a lot of already closed tickets that are merged ones and are not defined as merged.

We would really need an info from the API call could identify these tickets.

Thanks a lot

 

Regards


Hi Alessandro,

 

Yes, you are right. This workaround would be effective only for new tickets. Unfortunately, we would not be able to exclude the merged tickets data from the API call for old tickets as there are no unique parameters to identify and exclude the same. We can only view that by accessing specific tickets from the UI. Apologies for the limitations over Freshdesk here.

 

Let us know if you have further queries :)


We have also implemented this work-around. But an attribute on the ticket itself which is accessible through the API would still be preferred. 


Yes i know how to remove it


Reply