Skip to content

fix: convert Markdown when editing server issues - #1015

Open
ruangustavo wants to merge 1 commit into
ankitpokhrel:mainfrom
ruangustavo:ruangustavo/fix-server-edit-markdown
Open

fix: convert Markdown when editing server issues#1015
ruangustavo wants to merge 1 commit into
ankitpokhrel:mainfrom
ruangustavo:ruangustavo/fix-server-edit-markdown

Conversation

@ruangustavo

Copy link
Copy Markdown

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?

go test ./internal/cmd/issue/edit
PATH="$(go env GOPATH)/bin:$PATH" make lint
make test

The new tests cover:

  • headings, bullet lists, and textual checkboxes on Jira Server;
  • the existing Jira Cloud/ADF conversion path;
  • Jira Wiki Markup preservation;
  • unchanged Jira Server descriptions.

Checklist

  • I have added/updated enough tests related to my changes.
  • I have also manually checked and verified that my changes fix the issue and doesn't break any other functionalities.
  • My changes are backwards compatible.

Copilot AI lite review requested due to automatic review settings August 8, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 bodyForEdit helper 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants