fix: convert Markdown when editing server issues - #1015
Open
ruangustavo wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes jira issue edit for Jira Server by converting edited CommonMark descriptions into Jira Wiki Markup (Confluence-style) instead of sending raw Markdown that Jira Server misinterprets as Wiki Markup. It preserves existing Jira Cloud/ADF behavior, avoids double conversion when the edited text already looks like Jira Wiki Markup, and omits unchanged descriptions from the update payload.
Changes:
- Centralized description handling in a new
bodyForEdithelper that decides when to omit, preserve, or convert the body. - Added lightweight detection (
hasJiraWikiMarkup) to preserve Jira Wiki Markup on Jira Server and avoid double conversion. - Added focused unit tests covering Jira Server conversion, Jira Cloud/ADF conversion path, Wiki Markup preservation, and unchanged-body omission.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/cmd/issue/edit/edit.go | Routes edited descriptions through bodyForEdit, adds Jira Wiki Markup detection/preservation, and applies Markdown鈫扺iki conversion for Jira Server edits. |
| internal/cmd/issue/edit/edit_test.go | Adds unit tests validating the new bodyForEdit behavior across Server/Cloud and preservation/omission cases. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What does this PR solve?
Jira Server returns issue descriptions as strings. During
jira issue edit, Markdown conversion was only applied when the existing description was ADF, so CommonMark submitted through--body, stdin, or the editor was sent unchanged to Jira Server. Constructs such as## Objective, bullet lists, and textual checkboxes were consequently interpreted incorrectly as Jira Wiki Markup.This change converts edited CommonMark descriptions to Jira Wiki Markup for Jira Server as well. It keeps the existing Jira Cloud/ADF behavior, omits unchanged descriptions from the update, and preserves input that is already recognizable Jira Wiki Markup to avoid double conversion.
How to test?
The new tests cover:
Checklist