# Python API Ticket Merge Bug

**URL:** <https://community.hubspot.com/t/python-api-ticket-merge-bug/115415>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [August 28, 2024, 9:18pm UTC](https://community.hubspot.com/t/python-api-ticket-merge-bug/115415 "2024-08-28T21:18:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [August 28, 2024, 9:18pm UTC](https://community.hubspot.com/t/python-api-ticket-merge-bug/115415/1 "2024-08-28T21:18:23Z")

</div>

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](https://developers.hubspot.com/docs/api/crm/tickets)

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

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [August 29, 2024, 3:39pm UTC](https://community.hubspot.com/t/python-api-ticket-merge-bug/115415/2 "2024-08-29T15:39:47Z")

</div>

Hey @JFenchel 👋 Thanks for your post. Can you open an issue here, please? [Issues · HubSpot/hubspot-api-python · GitHub](https://github.com/HubSpot/hubspot-api-python/issues)

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

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [August 29, 2024, 3:48pm UTC](https://community.hubspot.com/t/python-api-ticket-merge-bug/115415/3 "2024-08-29T15:48:09Z")

</div>

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](https://developers.hubspot.com/docs/api/crm/tickets)
