ticket_data is not always a list - #7
Conversation
Running the `scaleuptechnologies.zammad.zammad_ticket` module resulted in an error, because the `ticket_data` did not contain a list, but just a dictionary. Zammad version: 7.0.0-1773148656.3c95b7da.bookworm
|
Thanks for your contribution! I'll take a look at it. |
cloucs
left a comment
There was a problem hiding this comment.
I might need a little more context. I just tested it in Zammad 7.0.0 and managed to create a ticket, using the module without encountering any problems. It returns a dictionary from which I can retrieve the ID using ticket_data.get("id"). There were no errors. Could you please describe in more detail when the error occurs and how I can reproduce it?
| ticket_data["article"]["sender"] = module.params["sender"] | ||
| ticket_data, status_code = create_ticket(module, zammad_access, ticket_data) | ||
| if isinstance(ticket_data, list): | ||
| ticket_id = ticket_data.get[0]("id") |
There was a problem hiding this comment.
That looks wrong to me. Maybe you meant this?
ticket_id = ticket_data[0].get("id")
| ticket_data["article"]["sender"] = module.params["sender"] | ||
| ticket_data, status_code = create_ticket(module, zammad_access, ticket_data) | ||
| if isinstance(ticket_data, list): | ||
| ticket_id = ticket_data.get[0]("id") |
There was a problem hiding this comment.
True, but in my case it doesn't hurt me, as I get a single ticket returned.
|
It really looks like it has to do with the Zammad installation. |
Running the
scaleuptechnologies.zammad.zammad_ticketmodule resulted in an error, because theticket_datadid not contain a list, but just a dictionary.Zammad version: 7.0.0-1773148656.3c95b7da.bookworm