You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2022/07/23 13:04:40 UTC
[lucene-jira-archive] 01/01: Port 'Environment' custom field
This is an automated email from the ASF dual-hosted git repository.
tomoko pushed a commit to branch port-environment-field
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git
commit 0132370eb956763a7933999cb1a98108bf08cef1
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Jul 23 22:04:28 2022 +0900
Port 'Environment' custom field
---
migration/src/jira2github_import.py | 4 ++++
migration/src/jira_util.py | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index 8e9779cf..be07d4b9 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -43,6 +43,7 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
description = extract_description(o).strip()
status = extract_status(o)
issue_type = extract_issue_type(o)
+ environment = extract_environment(o)
(reporter_name, reporter_dispname) = extract_reporter(o)
(assignee_name, assignee_dispname) = extract_assignee(o)
created = extract_created(o)
@@ -105,6 +106,9 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
elif created_datetime.date() != updated_datetime.date():
body += f", updated {updated_datetime.strftime('%b %d %Y')}"
+ if environment:
+ body += f'\nEnvironment:\n```\n{environment}\n```\n'
+
if len(attachment_list_items) > 0:
body += f'\nAttachments: {", ".join(attachment_list_items)}'
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 934b2069..49bfdf7f 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -41,6 +41,11 @@ def extract_issue_type(o: dict) -> str:
return issuetype.get("name", "") if issuetype else ""
+def extract_environment(o: dict) -> str:
+ environment = o.get("fields").get("environment", "")
+ return environment if environment else ""
+
+
def extract_reporter(o: dict) -> tuple[str, str]:
reporter = o.get("fields").get("reporter")
name = reporter.get("name", "") if reporter else ""