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: