APIs & Integrations

aolvikash
Participant

Ticket API Query help

Hello,

 

Need one help !!

Trying to collect the ticket info based on subject, I have used operator as CONTAINS_TOKEN to add the serach on query but this is not correct !!

 

Here is one of the example:

 

query- /crm/v3/objects/tickets/search
data - {"filters":[{"propertyName":"subject","value":"xyx Metrics (metrics_name) server.domian.com","operator":"CONTAINS_TOKEN"},{"operator":"IN","values":["1","80186","10","16"],"propertyName":"hs_pipeline_stage"}],"limit":1,"properties":["hs_object_id","hs_pipeline_stage","current_status"],"sorts":[{"propertyName":"createdate","direction":"DESCENDING"}],"after":0}

 

I need to collect the ticket info where subject should exactly start with "xyx subject (subject-name)" and then want to add wild card as "*<server.domain.name>" however above query is not doing so.

 

Could you please provide your thought on this.

Thanks in advance!!

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Ticket API Query help

Hey, @aolvikash 👋 It looks like the major challenge will be a limitation of the Search API, the CONTAINS_TOKEN operator doesn't work the way you are trying to use it. While it will look for terms you specify, there is no way to “force” it to search from the beginning and then *wildcard the rest. 

 

You'll need to query the data you want and then refine it more on your end.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
aolvikash
Participant

Ticket API Query help

Hey Jaycee,

 

Thanks.
Then what is the best approach to get this query work!!

0 Upvotes