We are trying to migrate to v2 API. We had previously used a view with the v1 api. We have reconstructed the criteria but we are unable to filter by ticket type of “service request”
Invoke-RestMethod -Method Get -Uri '
https://company.freshservice.com/api/v2/tickets/filter?query=“type:%20Service%20Request%27%20and%20status:2%20and%20group_id:25000004910”’ -Headers $Global:FS.HTTPHeaders
i’ve tried type, ticket_type
and i’ve tried a space (%20) or + between service and request. but they all return 400 bad request.
If i remove the “type” filter, the api succeeds.
May 10, 2023, 11:06am
@Justin_Marshall, looking at the freshservice api v2 documentation, ticket_type doesn’t look to be a support field for filtering tickets.
Strange that its not a possibility in the newer API version. I feel like this would be quite beneficial to us all. Hopefully by bringing this issue up here we can get it into the correct hands and have them add this filter capability. Or at least help you find a suitable workaround for your use case.
Best of luck!
Thanks Zachary. this seems like a pretty fundamental requirement. the “view list of tickets” does support ticket type, but then doesn’t allow filtering.
e.g. Invoke-RestMethod -Method Get -Uri ‘
I tried combining both query parameters:
Invoke-RestMethod -Method Get -Uri ‘ https://company.freshservice.com/api/v2/tickets/filter?query=“status:2%20and%20group_id:25000004910”&type=Service+Request’
However this generates a “bad request” as well.