preserve Jira 'Labels' (#68)
diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index be07d4b..e7c4080 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -55,7 +55,8 @@
attachments = extract_attachments(o)
linked_issues = extract_issue_links(o)
subtasks = extract_subtasks(o)
- pull_requests =extract_pull_requests(o)
+ pull_requests = extract_pull_requests(o)
+ jira_labels = extract_labels(o)
reporter_gh = account_map.get(reporter_name)
reporter = f"{reporter_dispname} (@{reporter_gh})" if reporter_gh else f"{reporter_dispname}"
@@ -189,6 +190,8 @@
labels.append(l)
else:
logger.error(f"Unknown Component: {c}")
+ for label in jira_labels:
+ labels.append(f"legacy-jira-label:{label}")
data = {
"issue": {
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 49bfdf7..d939f3d 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -84,6 +84,10 @@
return [x.get("name", "") for x in o.get("fields").get("components", [])]
+def extract_labels(o: dict) -> list[str]:
+ return o.get("fields").get("labels", [])
+
+
def extract_attachments(o: dict) -> list[tuple[str, int]]:
attachments = o.get("fields").get("attachment")
if not attachments: