From b6e718ca52d8dc21b90e085c7e3b3dbb1a67e12a Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Fri, 1 Oct 2021 11:41:00 -0700 Subject: [PATCH] Fixing user mapping issue and history import writing. --- trello2redmine.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/trello2redmine.py b/trello2redmine.py index da9954b..c8f99b9 100755 --- a/trello2redmine.py +++ b/trello2redmine.py @@ -28,7 +28,7 @@ if len(sys.argv) > 3 or (len(sys.argv) == 2 and sys.argv[1] == "-h"): # If a dry run, JSON is printed instead of submitted to Redmine. dry_run = len(sys.argv) == 2 and sys.argv[1] == "-c" -dry_run = True +# dry_run = True if dry_run: print("Making a dry run! Re-run with -c to commit the import into Redmine.") else: @@ -431,9 +431,9 @@ def _set_tracker_or_status(c): w_ids = [] for mid in c["idMembers"]: if a_id is None: - a_id = mid + a_id = user_map[mid] else: - w_ids.append(mid) + w_ids.append(user_map[mid]) if a_id is not None: result["assigned_to_id"] = a_id @@ -519,7 +519,6 @@ def handle_attachments(c): dry_run_counter = 0 -import_counter = 0 for c in board["cards"]: if dry_run and dry_run_counter > 0: print("ENDING DRY RUN") @@ -651,10 +650,9 @@ for c in board["cards"]: else: print(str(result)) + if issue_id > 0: import_history.append(c["id"]) - import_counter += 1 - if import_counter >= 5: - write_import_history() + write_import_history() # print("Aborting after one for testing") # sys.exit(0) -- 2.43.0