[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:
parent
807ed89c08
commit
50084f6ab3
1 changed files with 2 additions and 2 deletions
|
@ -149,12 +149,12 @@ def create_zammad_ticket(id, zammad, h2t, retries=3):
|
||||||
zammad_ticket_template["article"]["body"] = "RT ticket merged into {}".format(
|
zammad_ticket_template["article"]["body"] = "RT ticket merged into {}".format(
|
||||||
rt_ticket["ticket"]["numerical_id"]
|
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:
|
else:
|
||||||
zammad_ticket_template["state_id"] = STATUSMAP[rt_ticket["ticket"]["Status"]]
|
zammad_ticket_template["state_id"] = STATUSMAP[rt_ticket["ticket"]["Status"]]
|
||||||
body = rt_ticket["history"][0]["Content"] or 'RT Import: empty comment.'
|
body = rt_ticket["history"][0]["Content"] or 'RT Import: empty comment.'
|
||||||
zammad_ticket_template["article"]["body"] = body
|
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}")
|
print(f"Created Zammad ticket {zammad_ticket['id']} for {label}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue