File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 import os
5454 from pathlib import Path
5555
56+ def text_to_adf(text: str) -> dict:
57+ lines = text.splitlines()
58+ if not lines:
59+ lines = ["(No issue body provided)"]
60+
61+ content = []
62+ for idx, line in enumerate(lines):
63+ if line:
64+ content.append({"type": "text", "text": line})
65+ if idx < len(lines) - 1:
66+ content.append({"type": "hardBreak"})
67+
68+ if not content:
69+ content = [{"type": "text", "text": "(No issue body provided)"}]
70+
71+ return {
72+ "type": "doc",
73+ "version": 1,
74+ "content": [
75+ {
76+ "type": "paragraph",
77+ "content": content,
78+ }
79+ ],
80+ }
81+
5682 issue_title = os.environ["ISSUE_TITLE"]
5783 issue_body = os.environ.get("ISSUE_BODY", "") or ""
5884 issue_url = os.environ["ISSUE_URL"]
86112 if isinstance(override_fields, dict):
87113 custom_fields.update(override_fields)
88114
89- description = (
115+ description_text = (
90116 f"GitHub issue: {issue_repo}#{issue_number}\\n"
91117 f"URL: {issue_url}\\n\\n"
92118 f"{issue_body if issue_body else '(No issue body provided)'}"
96122 "project": {"key": os.environ["JIRA_PROJECT_KEY"]},
97123 "issuetype": {"name": os.environ["JIRA_ISSUE_TYPE"]},
98124 "summary": issue_title,
99- "description": description ,
125+ "description": text_to_adf(description_text) ,
100126 "labels": labels,
101127 }
102128 if components:
You can’t perform that action at this time.
0 commit comments