APIs & Integrations

Not applicable

API for Ticket Pipelines and Stage

Hello!

When creating a ticket one has to set a pipeline and stage on a ticket. But there is no documentation on how to read ticket pipelines and stages over the API.

Is there an API for that?

Thanks,
Anton

0 Upvotes
15 Replies 15
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @saurabh442,

You can just use the ticket's objectId, which is returned when pulling tickets via the Tickets API:

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @wei (and others),

We've quite recently released the CRM Pipelines API, which works for both Tickets and Deals. It will also work with any future objects that have pipelines. Here's a link to the docs:

https://developers.hubspot.com/docs/methods/pipelines/pipelines_overview

0 Upvotes
wei
Member

API for Ticket Pipelines and Stage

@Derek_Gervais Has there been any updates on the availability of a Ticket Pipelines API?

If there's no Ticket Pipelines API, how can we create or update tickets if the customer has non-default pipelines and/or custom stages set up? Additionally, how would we know whether each pipeline stage corresponds to the Open or Closed state enums?

Thanks!

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @saurabh442,

The only issue with that request body is the status property you're trying to set. You can cut that entirely; that value is set by the hs_pipeline_stage property. Your request body should look like this:

[
  {
    "name": "source_type",
    "value": "CHAT"
  },
  {
    "name": "created_by",
    "value": "3449104"
  },
  {
    "name": "subject",
    "value": "testing subject"
  },
  {
    "name": "hs_pipeline",
    "value": "0"
  },
  {
    "name": "hs_pipeline_stage",
    "value": "1"
  },
  {
    "name": "content",
    "value": "Here are the details of the ticket."
  }
]
0 Upvotes
saurabh100
Member

API for Ticket Pipelines and Stage

When I get to fetch all the tickets value using API not found this below value.
{
"name": "created_by",
"value": "3449104"
},

OR
I want a unique ID to map with Jira ticket ID can you please provide me optional object ID objectId":935677 for mapping purpose, I mean if this objectId ticket is already created in HubSpot then will skips otherwise it will automatically create a new ticket ID. please provide me solution for this I was stuck last 1 months only for this API.

0 Upvotes
saurabh100
Member

API for Ticket Pipelines and Stage

Thanks @Derek_Gervais It's working!

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @saurabh442,

That error appears to reference a status property, not specifically hs_pipeline_status. Can you give me an example of a raw request you're making?

@abhimanyu_singh we generally don't write code to interact with the HubSpot API, though there are a number of third party libraries out there that can help. If you have any specific technical questions / issues with the Tickets API, please create a separate topic with the details of the request you're making and the response you're receiving.

0 Upvotes
saurabh100
Member

API for Ticket Pipelines and Stage

@Derek_Gervais

That's The Code I'm Try to create the Ticket Using API

<?php $str_post = '[{ "name": "source_type", "value": "CHAT" }, { "name": "status", "value": "IN_PROGRESS" }, { "name": "created_by", "value": "3449104" }, { "name": "subject", "value": "testing subject" }, { "name": "hs_pipeline", "value": "0" }, { "name": "hs_pipeline_stage", "value": "1" }, { "name": "content", "value": "Here are the details of the ticket." }]'; $endpoint = 'https://api.hubapi.com/crm-objects/v1/objects/tickets?hapikey=XYZ'; $ch = @curl_init(); @curl_setopt($ch, CURLOPT_POST, true); @curl_setopt($ch, CURLOPT_POSTFIELDS, $str_post); @curl_setopt($ch, CURLOPT_URL, $endpoint); @curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' )); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = @curl_exec($ch); $status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE); @curl_close($ch); echo $status_code . " " . $response; ?>
0 Upvotes
saurabh100
Member

API for Ticket Pipelines and Stage

@Derek_Gervais

Could you please send me a simple API Linked how to create the ticket in Hubspot, That you have tested in Postman, I need that if your creating ticket API is worked properly, otherwise clearly says in the comment it is not working.

0 Upvotes
saurabh100
Member

API for Ticket Pipelines and Stage

I have set the hs_pipeline is 0 and hs_pipeline_status is 1. Now i am getting this issue
{"status":"error","message":"{"status":"error","message":"Property values were not valid","validationResults":[{"isValid":false,"message":"Property \"status\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"status"}]}","correlationId":"XXXXXXXXXXXXXX","requestId":"YYYYYYYYYYYYYYYYYYYYYYYYYYYY"}

Not applicable

API for Ticket Pipelines and Stage

Yes The same issue i was faced how worst service provided by hubspot guys if you know the people are facing the same issue so you guys are not provide a simple run able code, please provide us simple code to create the tickets in hubspot I've wasted so many times on this and i'm frustrate.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @Anton_Litvinenko,

I totally understand the confusion; this API is a work in progress. While there isn't a pipelines API yet, you can still create tickets using the default pipeline and using the raw values for the different statuses:

  • For the hs_pipeline property, the default pipeline ID is 0
  • For the hs_pipeline_status property, the default stage IDs are:
    • New is 1
    • Waiting on contacts is 2
    • Waiting on us is 3
    • Closed is 4

Stay tuned for more updates on the APIs currently in dev preview; we're looking to continue to make improvements in the coming weeks.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API for Ticket Pipelines and Stage

Hi @Anton_Litvinenko,

The Tickets API is currently in developer preview, and as such there isn't currently an API to read/manage ticket pipelines. It's something the team is working on but I don't have any timeframes at the moment. Feel free to subscribe to our changelog for updates.

0 Upvotes
shreya_verma
Member

API for Ticket Pipelines and Stage

Hi, to add to these questions, is there a way to filter tickets by the `hs_pipeline_stage` property? For instance I just want tickets at stage "0". Thank you.

0 Upvotes
Not applicable

API for Ticket Pipelines and Stage

@Derek_Gervais this seems strange. How one supposed to use Tickets API and create tickets without being able to set a proper value to the ticket stage field (which is mandatory btw)?

0 Upvotes