Fix custom ADF fields showing [object Object] in edit mode#1672
Open
tobiaswadsethdev wants to merge 2 commits intoatlassian:mainfrom
Open
Fix custom ADF fields showing [object Object] in edit mode#1672tobiaswadsethdev wants to merge 2 commits intoatlassian:mainfrom
tobiaswadsethdev wants to merge 2 commits intoatlassian:mainfrom
Conversation
Custom Jira paragraph/rich-text fields (e.g. customfield_10057) store values as ADF objects. When entering edit mode, the raw object was passed directly to EditRenderedTextArea which coerced it to '[object Object]' in the textarea. On save, the plain string was sent to Jira Cloud which rejected it with: 'Operation value must be an Atlassian Document'. Fix: detect ADF objects in the editmode multiline branch and convert them to WikiMarkup for display (using existing convertAdfToWikimarkup), then convert back to ADF on save (using convertWikimarkupToAdf). Plain string values (Jira DC) pass through unchanged.
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.
Summary
Custom Jira paragraph/rich-text fields store their values as Atlassian Document Format (ADF) objects. When entering edit mode, the raw object was passed directly to
EditRenderedTextArea, which coerced it to[object Object]in the textarea. On save, the plain string was sent to Jira Cloud, which rejected it with "Operation value must be an Atlassian Document".Root cause:
AbstractIssueEditorPage.getInputMarkup()passedfieldValues[field.key]directly toEditRenderedTextArea.textwith no ADF detection or conversion. Thedescriptionfield already had this handled inIssueMainPanel.tsxbut custom multiline fields did not.Changes
src/webviews/components/issue/AbstractIssueEditorPage.tsxconvertWikimarkupToAdfto the existing import from./common/adfToWikimarkupeditmode + isMultilinebranch: detect whether the stored field value is an ADF object (type === 'doc' && version === 1), convert to WikiMarkup for display viaconvertAdfToWikimarkup, and convert back to ADF on save viaconvertWikimarkupToAdfTest plan
[object Object]Rovo Dev code review: Rovo Dev couldn't review this pull request
Upgrade to Rovo Dev Standard to continue using code review.