Using POST in search ticket is returning hs_pipeline and hs_pipeline_stage as number

I am using POST on search for tickets.
I get the hs_pipeline and hs_pipeline_stage as number

How can I display as text (using the pipeline name and stage) instead of a number?

Trying to intergate it to ZD AI bot

Hi @YLabrou

You’ll need to retrieve the pipeline definitions using the Pipelines API.

here is the link for your reference - https://api.hubapi.com/crm/v3/pipelines/tickets?hapikey=your_api_key

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

Hi @YLabrou :waving_hand:

You’ll need to perform a lookup, potentially via the Get Ticket Stages HubSpot API endpoint. For example:

GET https://api.hubapi.com/crm/v3/pipelines/tickets/**:PIPELINE\_ID**/stages

e.g. GET https://api.hubapi.com/crm/v3/pipelines/tickets/**0**/stages

{
 "results": [
 {
 "label": "Support | New", // ticket status label
 "displayOrder": 0,
 "metadata": {
 "ticketState": "OPEN",
 "isClosed": "false"
 },
 "id": "1", // ticket status id
 "createdAt": "1970-01-01T00:00:00Z",
 "updatedAt": "2023-08-01T05:06:27.529Z",
 "archived": false,
 "writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"
 },
 {
 "label": "Support | In Progress",
 "displayOrder": 1,
 "metadata": {
 "ticketState": "OPEN",
 "isClosed": "false"
 },
 "id": "10112923",
 "createdAt": "2021-12-16T16:13:51.492Z",
 "updatedAt": "2023-08-01T05:06:27.529Z",
 "archived": false,
 "writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"
 },
 {
 "label": "Support | Resolved",
 "displayOrder": 2,
 "metadata": {
 "ticketState": "CLOSED",
 "isClosed": "true"
 },
 "id": "10112924",
 "createdAt": "2021-12-16T16:13:51.492Z",
 "updatedAt": "2023-08-01T05:06:27.529Z",
 "archived": false,
 "writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"
 }
 ]
}

I hope that proves helpful. Please let me know if you have any follow-up questions.