From e9d28bde1ff1347809885ddd6eded5d358447594 Mon Sep 17 00:00:00 2001 From: kjg Date: Fri, 2 Aug 2024 16:21:04 +0900 Subject: [PATCH] [rt2zammad] update range] --- fs2zammad | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fs2zammad b/fs2zammad index e5669bd..5a90119 100755 --- a/fs2zammad +++ b/fs2zammad @@ -280,8 +280,17 @@ if not os.path.exists("rt2zammad.json"): with open("rt2zammad.json") as handle: config = json.load(handle) -rt_start = config["rt_start"] -rt_end = config["rt_end"] +#import_start = config["rt_start"] +#import_end = config["rt_end"] + +if len(sys.argv) != 3: + print(len(sys.argv)) + print("It needs ticket range to import ex. start, end") + sys.exit() +else: + import_start = int(sys.argv[1]) + import_end = int(sys.argv[2]) + print(f"start : {import_start} end : {import_end}") h2t = html2text.HTML2Text() zammad = get_zammad_session() @@ -296,7 +305,7 @@ ticket_ids = os.listdir("tickets/") print(f"Found {len(ticket_ids)} tickets on filesystem.") ticket_ids = list(map(int, ticket_ids)) ticket_ids.sort() -ticket_ids = list(map(int, ticket_ids[rt_start:rt_end])) +ticket_ids = list(map(int, ticket_ids[import_start-1:import_end])) for id in ticket_ids: try: