Skip to main content

Hi, i want to search tickets on basis of Title or Description with the help of API.So far i can get all the tickets or a specific ticket using this "/api/v2/tickets/" but i would like to know if there is a way to filter/search using a specific key word with the API.


Something like this "/search/tickets?term=bug" or /search/tickets?query=bug


Thank you



Hello Satwant,


Filter tickets API allows you to search for tickets that are grouped together under a common criteria. It can be the default system fields like type, group, tags etc. or even your custom text/dropdown fields. Do you think this would help though it doesn't filter by subject?


Cheers!



Hi Aravind,


Thanks for the reply. I don't need to filter by subject necessarily as long as the ticket contains the word i am looking for. Could you give me an example of custom text field?




Hello Satwant, 


Here's a sample query I've constructed to filter tickets with a specific keyword in one of the custom text fields.


curl -v -u APIKEY:X -X GET 'https://domain.freshdesk.com/api/v2/search/tickets?query="(cf_testing:%27Test%27)"'



Here, cf_testing is the custom field name and the keyword is Test. As highlighted here, the query parameter has been URL encoded.


Cheers!



Till today this doesn't return any values

 

{

"results": ],

"total": 0

}

 




Hello!


Every query used to filter tickets via API should be constructed based on the ticket fields, either default or custom configured in your helpdesk. The below documentation link would help you get detailed insights on the same:

https://developer.freshdesk.com/api/#filter_tickets


If you are still facing trouble getting the API results, please drop an email to support@freshdesk.com and we would be happy to help!


Cheers. :)


None of the responses here really address the question. There seems to be a lot of people having issues with this. To be super clear given the following ticket:

[
  {
    "cc_emails": "],
    "fwd_emails": l],
    "reply_cc_emails": a],
    "ticket_cc_emails": e],
    "fr_escalated": true,
    "spam": false,
    "email_config_id": null,
    "group_id": 1101000205602,
    "priority": 1,
    "requester_id": 50000010459464,
    "responder_id": null,
    "source": 3,
    "company_id": null,
    "status": 2,
    "subject": "hello world tracker",
    "association_type": 3,
    "support_email": null,
    "to_emails": null,
    "product_id": null,
    "id": 53,
    "type": null,
    "due_by": "2024-05-06T16:00:00Z",
    "fr_due_by": "2024-05-06T16:00:00Z",
    "is_escalated": true,
    "custom_fields": {
      "cf_catagory": null,
      "cf_subcatagory": null,
      "cf_users_office": null,
      "cf_pulse_system_notifcations": null,
      "cf_country_code": null
    },
    "created_at": "2024-05-06T07:25:14Z",
    "updated_at": "2024-05-06T16:15:53Z",
    "associated_tickets_count": 2,
    "tags": 0],
    "internal_agent_id": null,
    "internal_group_id": null,
    "nr_due_by": null,
    "nr_escalated": false
  },
  {
    "cc_emails": y],
    "fwd_emails": c],
    "reply_cc_emails": ],
    "ticket_cc_emails": b],

…………..

 

 

I want to be able to run a query and search for the term `hello` or `hello world` and have it match this in the results. Right now i cannot see how this can be done and the docs completely skip over this critical element. 

 

Is there really no way to search tickets using the api?


Reply