chore: enhance issue body formatting for Jira integration#514
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions workflow that creates Jira issues on GitHub issue open, aiming to improve how the GitHub issue body is formatted when sent to Jira.
Changes:
- Added a small Python helper to convert plain text into Jira Atlassian Document Format (ADF).
- Switched Jira payload generation to send
fields.descriptionas ADF instead of a raw string.
Comment on lines
+56
to
+70
| 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)"}] | ||
|
|
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?