[fs2zammad] create new tickets using admin session instead of customer session

... we get cryptic errors (wrong value for field x) if we don't have
enough privileges.
This commit is contained in:
fnux 2024-05-07 12:32:58 +02:00
parent 807ed89c08
commit 50084f6ab3
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12

View file

@ -149,12 +149,12 @@ def create_zammad_ticket(id, zammad, h2t, retries=3):
zammad_ticket_template["article"]["body"] = "RT ticket merged into {}".format(
rt_ticket["ticket"]["numerical_id"]
)
zammad_ticket = get_zammad_session(creator).ticket.create(zammad_ticket_template)
zammad_ticket = zammad.ticket.create(zammad_ticket_template)
else:
zammad_ticket_template["state_id"] = STATUSMAP[rt_ticket["ticket"]["Status"]]
body = rt_ticket["history"][0]["Content"] or 'RT Import: empty comment.'
zammad_ticket_template["article"]["body"] = body
zammad_ticket = get_zammad_session(creator).ticket.create(zammad_ticket_template)
zammad_ticket = zammad.ticket.create(zammad_ticket_template)
print(f"Created Zammad ticket {zammad_ticket['id']} for {label}")