How to sort ticket list by custom field

how to sort ticket list by custom field.

hey @Nikhil you can filter tickets with custom field .

API - /api/v2/search/tickets?query=[query] (refer : Filter api)

eg : /api/v2/search/tickets?custom_field_name=custom_field_value

This will return an array of tickets which has the custom_field_value .

Hope this helps you ! :slightly_smiling_face:

2 Likes

Hi Janani,
Thanks for feedback,
but How to achive this on Freshdesk tool/client ?

Hi @Nikhil,

Welcome to Freshworks Developer Community :tada:

From the above comments we understand, you were trying to filter tickets with custom filed. Is that you need to do it via Freshdesk SDK / client.Request?

You can use request api. ( refer -Request method)

Sample :

var headers = {"Authorization": "Basic <%= encode(api_key) %>"};
var options = { headers: headers };
client.request.get("https://<domain>/api/v2/search/tickets?custom_field_name=custom_field_value", options)
  .then(
    function(data) {
console.log("filtered Data",data);
    },
    function(error) {
    console.erroe(error)
    }
  );
3 Likes

Hi Ajmal,

i want to do via freshDesk SDK.

is there any way, that can be done?

Thanks for the reply,

but we are looking for filter condition with in FD tool,
or any other way we can can add custom filter to the drop down of teicket list page