Python API Ticket Merge Bug

Hi,

I was trying to merge tickets using the HubSpot Client pacakage in python. But I kept getting the error message:

AttributeError: ‘Discovery’ object has no attribute ‘public_object_api’

But I could merge tickets using the requests package making the post call. I then found that in the file hubspot/discovery/crm/tickets/discovery.py it’s missing the lines

@property

def public_object_api(self) → api_client.PublicObjectApi:

return self._configure_api_client(api_client, “PublicObjectApi”)

This was missing in the source code available online too. I copied that from the same file in companies. After adding that I could perform a merge using the code as described in the API reference

I wanted to flag this both for other people having the same issue and as a bug to be fixed by HubSpot

Hey @JFenchel :waving_hand: Thanks for your post. Can you open an issue here, please? Issues · HubSpot/hubspot-api-python · GitHub

Additionally, if you’ll copy + paste the solution into a new comment, I can accept your reply as the solution.

Best,

Jaycee

If you go to the source code (for me it’s in C:/Users/my_name/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0/LocalCache/local-packages/Python311/site-packages/hubspot ) and find the file discovery/crm/tickets/discovery.py it’s missing the lines

@property

def public_object_api(self) → api_client.PublicObjectApi:

return self._configure_api_client(api_client, “PublicObjectApi”)

You can copy paste that added in the property definitions section and save and then the api should work as specifiec in the API reference