From 50084f6ab3e1e64cb8e93d1ccf293bb2864278e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Tue, 7 May 2024 12:32:58 +0200 Subject: [PATCH] [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. --- fs2zammad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs2zammad b/fs2zammad index 34ab4cb..8095b9f 100755 --- a/fs2zammad +++ b/fs2zammad @@ -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}")