fix: render ADF document custom fields as plain text#407
Open
tio-foosy wants to merge 4 commits into
Open
Conversation
FormatCustomFieldValue's map[string]any case did not detect Atlassian Document Format objects (type: 'doc'), causing ADF-backed custom fields (e.g. textarea, paragraph-rich) to render as '-' in 'issues get'. Add ADF detection: when the map has type='doc', marshal+unmarshal into ADFDocument and call ToPlainText() to extract readable text. Fixes reading of fields like 'Changelog Entry' that use ADF storage.
Automated PR ReviewReviewed commit: Summary
0 PR discussion threads considered. 0 summarized; 0 resolved. Completed in 1m 09s | ~$0.12 (est.) | claude-sonnet-4-6 | cr 0.4.161
Per-workstream usage
|
piekstra-dev
approved these changes
Jun 17, 2026
piekstra-dev
left a comment
There was a problem hiding this comment.
Automated PR review completed with outcome: approved.
Add extension.Linkify to both mdParser and wikiParser so that bare URLs (e.g. https://example.com) in --description and --body text are automatically converted to clickable ADF hyperlinks.
When --description is used, the current issue is fetched first. Any mediaSingle/mediaGroup nodes (images, attachments) in the existing description are preserved and appended after the new markdown content. This prevents accidental deletion of embedded images when replacing text in a description.
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.
Problem
jtk issues get --fields "Changelog Entry"(and any ADF-backed custom field) displays-instead of the actual content.Root cause: In
FormatCustomFieldValue, themap[string]anycase only looks for keysvalue,name,displayName. ADF documents havetype: "doc"and none of those — so they fall through toreturn "", which becomes"-"" viaOrDash`.This is the read side of ADF handling — #191 addressed the write path (auto-wrapping plaintext into ADF on update), but reading stored ADF values was still broken.
Fix
Detect ADF documents (maps with
type: "doc") in themap[string]anycase, marshal+unmarshal intoADFDocument, and call the existingToPlainText()method.Changes
tools/jtk/api/issues.go: Add ADF detection inFormatCustomFieldValue(7 lines)tools/jtk/api/issues_extract_test.go: Addadf_documenttest caseTesting
map[string]any{"type":"doc",...}→"Hello ADF\n"jtk issues get TIO-270 --fields "Changelog Entry"now shows the actual text