From 57d039703b2a64bce5607dd20e36ac3b0888e6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 18 Aug 2020 13:00:37 +0200 Subject: [PATCH] Improve automated commets --- rt2zammad.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rt2zammad.py b/rt2zammad.py index a7cf895..48dbb1f 100755 --- a/rt2zammad.py +++ b/rt2zammad.py @@ -39,6 +39,7 @@ TEMPLATE = """{ COMMENT_TEMPLATE = """ Ticket imported from Request Tracker +URL: https://support.weblate.org/Ticket/Display.html?id={numerical_id} Created: {Created} Resolved: {Resolved} """ @@ -172,14 +173,14 @@ def get_user(userdata, attr="login"): # Create tickets for ticket in tickets: - label = "RT-{}".format(ticket["ticket"]["id"].split("/")[1]) + label = "RT-{}".format(ticket["ticket"]["numerical_id"]) print("Importing {}".format(label)) new = get_zammad(get_user(users[ticket["ticket"]["Creator"]])).ticket.create( { "title": "{} [{}]".format(ticket["ticket"]["Subject"], label), "group": "Users", "state_id": STATUSMAP[ticket["ticket"]["Status"]], - "note": "RT-import:{}".format(ticket["ticket"]["id"]), + "note": "RT-import:{}".format(ticket["ticket"]["numerical_id"]), "article": { "subject": ticket["ticket"]["Subject"], "body": ticket["history"][0]["Content"],