Hello!
I have created a custom object in my Hubspot instance and I’m trying to use this as a parent ticket of various tickets that are a similar issue.
I’m now looking for a NodeJS code that will allow me to search issues within this custom object that has a title of [abc123]. This [abc123] is a property in the child ticket so when Hubspot finds the parent ticket with title [abc123] it will associate both parent ticket to child ticket.
Hey, @andy_gh
Thanks for reaching out.
Your use case involves several steps and would need multiple API calls.
One high-level approach is to:
- Search for the Custom Object: Use the Search API endpoints to search for your custom object record that has a title of [abc123]. This gives you the ID of the custom object, which you can use to create the association with the child ticket later
- Search for the Child Tickets: Use the Search API endpoints again to search for the child tickets that have the property [abc123]. You will get a list of child ticket IDs
- Create Associations: For each child ticket ID from step 2, use the Associations endpoint to associate the child ticket with the parent custom object ID from step 1
Other considerations:
- rate limits
- pagination
- error handling
- caching
And remember, when asking a question, try to be as specific as possible. Information about:
- what you have tried
- what the expected and actual results were
- any error messages you received
This will make it easier for others to understand your issue and provide helpful responses.
Have fun building! — Jaycee
Hey @andy_gh !
This isn’t a NodeJS code for creating associations, but we have an app, Associ8, that allows for automatic associations via workflows. Meaning you can accomplish this without the need for a Custom Coded Action.
Here is an example of what the Associ8 action to accomplish your needs would look like:
This workflow action would work by taking the value from the “Parent Ticket Title” property on the ticket field to search through the Parent Tickets “Title” property in order to find a matching value. Once that match is found the association will be made.
LMK if you have any Qs!
Cheers ![]()
-Jonathan
