Skip to content

Fix custom ADF fields showing [object Object] in edit mode#1672

Open
tobiaswadsethdev wants to merge 2 commits intoatlassian:mainfrom
tobiaswadsethdev:fix/custom-adf-fields-object-object
Open

Fix custom ADF fields showing [object Object] in edit mode#1672
tobiaswadsethdev wants to merge 2 commits intoatlassian:mainfrom
tobiaswadsethdev:fix/custom-adf-fields-object-object

Conversation

@tobiaswadsethdev
Copy link
Copy Markdown

@tobiaswadsethdev tobiaswadsethdev commented Mar 2, 2026

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() passed fieldValues[field.key] directly to EditRenderedTextArea.text with no ADF detection or conversion. The description field already had this handled in IssueMainPanel.tsx but custom multiline fields did not.

Changes

src/webviews/components/issue/AbstractIssueEditorPage.tsx

  • Added convertWikimarkupToAdf to the existing import from ./common/adfToWikimarkup
  • In the editmode + isMultiline branch: detect whether the stored field value is an ADF object (type === 'doc' && version === 1), convert to WikiMarkup for display via convertAdfToWikimarkup, and convert back to ADF on save via convertWikimarkupToAdf
  • Plain string values (Jira DC) pass through unchanged — no regression

Test plan

  • Open an issue with a custom paragraph/rich-text field containing text — clicking the field should show readable text, not [object Object]
  • Edit the text and save — should succeed without the "Operation value must be an Atlassian Document" error
  • Verify saved content appears correctly in Jira web UI
  • Test an empty custom field — save should still work
  • Test on a Jira DC instance — field should still receive WikiMarkup (not an ADF object)

Rovo Dev code review: Rovo Dev couldn't review this pull request
Upgrade to Rovo Dev Standard to continue using code review.

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

1 participant