Skip to content

fix(jira): descriptions keep their text through a Markdown round trip - #39982

Closed
PixPMusic wants to merge 2 commits into
pingdotgg:mainfrom
PixPMusic:fix/jira-adf-fidelity
Closed

PixPMusic wants to merge 2 commits into
pingdotgg:mainfrom
PixPMusic:fix/jira-adf-fidelity

Conversation

@PixPMusic

Copy link
Copy Markdown
Contributor

Targets issues/jira (#38003).

This closes the fidelity gap with #39168's converter and keeps #38003's nesting rule. Inside list items and quotes, headings become paragraphs, rules are dropped, tables are flattened and nested quotes are unwrapped, so Jira never rejects the document.

Problem

Jira stores descriptions and comments as Atlassian Document Format (ADF), and T3 Code edits them as Markdown. The converter in #38003 lost text both ways:

  • *foo* typed in Jira came back as italic foo.
  • Inline code holding a backtick broke its fence.
  • A table with merged cells lost columns.
  • Saving an edit to a description with underline, coloured text, emoji, smart links or merged cells silently stripped them.
  • Reference links lost their URL.
  • Nested bold sent two strong marks.

Change

Each gap, with the test in packages/issue-tracker-jira/src/server/adf.test.ts that covers it. All four test cases fail on 2bfd3c8054.

  1. Escaping. Plain Jira text escapes backslash, backtick, *, ~, [, ], <, & and _. A paragraph line that starts with #, >, +, =, -, or 1./1) is escaped too. An underscore between letters or digits (snake_case, MAX_RETRIES) is left alone, because Markdown already reads it literally and agents read this text. Covered by "writes markdown as a Jira document and reads it back unchanged", in the two literal-text entries in MARKDOWN.
  2. Code fences are longer than any backtick run inside the code. Inline code is padded when it starts or ends with a backtick, or when it both starts and ends with a space. Covered by the same test, in the inline and nested code block entries.
  3. Tables: rows are padded to the widest row instead of the header. Covered by "reads what markdown cannot say as text and reports it as unwritable" (the merged header table).
  4. Refusing lossy edits. hasUnwritableContent also refuses emoji, inlineCard, colspan/rowspan > 1, and any mark other than link, code, strong, em and strike: for example underline, textColor, subsup and alignment. Covered by the same test, in the lossy list.
  5. Reference links and images become inline links, and the first definition wins. Covered by "writes a reference link as the inline link its first definition names".
  6. Marks are deduplicated by type. When code is present, only code and link are kept; for an image inside a link, the outer link wins. Covered by "writes only nodes Jira's schema accepts where markdown put them" (**a **b** c**).
  7. Ordered lists that start at 1 have no attrs.order. Covered by the same test.

Status lozenges also read without brackets (In Progress), and attachments read as (attachment, open in Jira to view).

Scope

Only adf.ts and its tests change. The converter runs on the server, so web, desktop and mobile all get the same issue body. Linear is unaffected. This doesn't conflict with #39941–#39944, #39979 or #39980, none of which touch adf.ts.

Verification

  • vp test run packages/issue-tracker-jira: 12 tests pass.
  • The same adf tests against the 2bfd3c8054 converter: all 4 fail. Run on its own, the refusal assertion fails for all 8 new lossy cases.
  • vp run check:changed upstream/issues/jira: format, lint, knip, typecheck and tests pass.
  • A throwaway ADF → Markdown → ADF probe over about 30 tricky inputs round-tripped all of them except the line-break case below.

Known gaps

  • A Jira line break inside a paragraph still reads as a Markdown soft break. It shows as a space and writes back as a newline in the text.
  • Bold or italic text with a leading or trailing space (**Note: **) does not read back as bold.
  • A Jira checklist is not refused. Editing a description that has one turns it into a bullet list with [x] text, as the existing code comment says.
  • The refusal message in JiraIssueTracker.ts still names only attachments, mentions and panels, though it now also fires for emoji, smart links, merged cells and formatting such as underline. It's left for a follow-up because feat(jira): collect required workflow transition fields #39941–fix(issues): search Jira assignees past the loaded catalogue #39944 edit that file.

Model: Claude Opus 5.5 (xhigh effort) | Harness: Claude Code in T3 Code

juliusmarminge and others added 2 commits November 17, 2026 00:03
Jira is connected in Settings with a site, an account email and an API token, and a
project is bound to one of its Jira projects the way a Linear team is. Issues list,
open, and take comments, edits, labels, an assignee and moves along the transitions
their workflow offers. Descriptions and comments are converted between Jira's document
format and markdown; a description holding attachments, mentions or panels is not
rewritten. Reactions and linked pull requests are not offered: Jira Cloud's public API
has neither.

A standalone tracker can now declare fields it needs beside its secret. The stored
credential stays the bare key for a tracker with none, so a saved Linear key still reads.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Reading now escapes Jira text that looks like Markdown, fences code that
holds backticks, and sizes tables by their widest row. Editing now refuses
descriptions with emoji, smart links, merged cells or marks Markdown cannot
write. Writing resolves reference links, sends one mark of each type, and
leaves out the start of a list that starts at 1. Status lozenges read
without brackets and attachments say to open Jira.
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 20, 2026
juliusmarminge added a commit that referenced this pull request Nov 27, 2026
…its, more than one site

Comments on a Jira Service Management issue were customer-visible replies; they are now
posted as internal notes. A markdown checklist is written back as a Jira task list instead
of a bullet list with literal "[x]" text. Descriptions keep their text through a markdown
round trip (from #39982). A status two transitions reach is refused until the move is named,
instead of silently running the first. Jira can be connected as more than one account, and
the Issues page names it "Jira" with its icon.

Co-Authored-By: Pixel Perfect <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
juliusmarminge added a commit that referenced this pull request Nov 27, 2026
…its, more than one site

Comments on a Jira Service Management issue were customer-visible replies; they are now
posted as internal notes. A markdown checklist is written back as a Jira task list instead
of a bullet list with literal "[x]" text. Descriptions keep their text through a markdown
round trip (from #39982). A status two transitions reach is refused until the move is named,
instead of silently running the first. Jira can be connected as more than one account, and
the Issues page names it "Jira" with its icon.

Co-Authored-By: Pixel Perfect <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge
juliusmarminge deleted the branch pingdotgg:issues/jira November 27, 2026 09:18
@juliusmarminge
juliusmarminge changed the base branch from issues/jira to main November 27, 2026 09:21
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Nov 27, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for this. Main has the change since #38003.

Main now includes your Jira description round-trip fixes: literal-text escaping, safe code fences, widest-row table padding, refusal of lossy edits, reference links, deduplicated marks and ordered-list normalization. I compared your current head's adf.ts and adf.test.ts directly with the merge: its regression cases remain, with additional fixes for checklists, whitespace, links, line breaks and nested lists.

Closing as superseded.

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

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants