python-freshdesk icon indicating copy to clipboard operation
python-freshdesk copied to clipboard

Can't get requester name

Open codepypl opened this issue 4 years ago • 3 comments

Ticket.name does not exist (official freshdesk api has this property) I also can't use ticket.contacts.get_contact(id) because it rises exception 'Freshdesk not found' why ?

codepypl avatar Apr 06 '21 22:04 codepypl

Can you please paste in the full exception including traceback that you're getting? Thanks

sjkingo avatar Apr 07 '21 19:04 sjkingo

`

        Freshdesk has deprecated their V1 API from 1st July, 2018.
        For more info, visit https://support.freshdesk.com/support/solutions/articles/231955-important-deprecation-of-api-v1
        
        For more info about freshdesk V2 API, visit https://developers.freshdesk.com/api/
        
        Now python-freshdesk library will by default return V2 API client. You need to migrate your project accordingly.

(env) ➜ DiscordBot python3 fresh.py

        Freshdesk has deprecated their V1 API from 1st July, 2018.
        For more info, visit https://support.freshdesk.com/support/solutions/articles/231955-important-deprecation-of-api-v1
        
        For more info about freshdesk V2 API, visit https://developers.freshdesk.com/api/
        
        Now python-freshdesk library will by default return V2 API client. You need to migrate your project accordingly.

Traceback (most recent call last): File "/Volumes/Dane/Projekty/DiscordBot/fresh.py", line 9, in print(ticket.name) AttributeError: 'Ticket' object has no attribute 'name'

simple for loop :

for ticket in f.tickets.list_new_and_my_open_tickets(): print(ticket.name)

`

codepypl avatar Apr 07 '21 21:04 codepypl

fixed by getting the name from ticket view the question is how to handle errors ?

codepypl avatar Apr 08 '21 17:04 codepypl