Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/jira_issue_on_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ jobs:
import os
from pathlib import Path

def text_to_adf(text: str) -> dict:
lines = text.splitlines()
if not lines:
lines = ["(No issue body provided)"]

content = []
for idx, line in enumerate(lines):
if line:
content.append({"type": "text", "text": line})
if idx < len(lines) - 1:
content.append({"type": "hardBreak"})

if not content:
content = [{"type": "text", "text": "(No issue body provided)"}]

Comment on lines +56 to +70
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text_to_adf() treats bodies that contain only blank lines as non-empty because it will emit only hardBreak nodes, so the “(No issue body provided)” placeholder is never used. This can result in Jira descriptions that appear empty/blank. Consider normalizing input with something like if not text.strip(): (or if not any(line.strip() for line in lines)) before building ADF content so whitespace-only bodies get the placeholder.

Copilot uses AI. Check for mistakes.
return {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": content,
}
],
}

issue_title = os.environ["ISSUE_TITLE"]
issue_body = os.environ.get("ISSUE_BODY", "") or ""
issue_url = os.environ["ISSUE_URL"]
Expand Down Expand Up @@ -86,7 +112,7 @@ jobs:
if isinstance(override_fields, dict):
custom_fields.update(override_fields)

description = (
description_text = (
f"GitHub issue: {issue_repo}#{issue_number}\\n"
f"URL: {issue_url}\\n\\n"
f"{issue_body if issue_body else '(No issue body provided)'}"
Expand All @@ -96,7 +122,7 @@ jobs:
"project": {"key": os.environ["JIRA_PROJECT_KEY"]},
"issuetype": {"name": os.environ["JIRA_ISSUE_TYPE"]},
"summary": issue_title,
"description": description,
"description": text_to_adf(description_text),
"labels": labels,
}
if components:
Expand Down
Loading