Problem
When editing an issue description, embedded media (images uploaded directly to the description) are lost because the entire ADF is replaced. These media elements have collection/ID references to Jira's media service that cannot be recreated from the filename alone.
Example of lost media:
{
"type": "mediaSingle",
"content": [{
"type": "media",
"attrs": {
"id": "abc-123-media-id",
"collection": "contentId-12345",
"type": "file"
}
}]
}
Proposed Solution
When editing a description:
- Fetch the existing description ADF
- Extract all
mediaSingle/media nodes
- When converting new Markdown to ADF, check for
!media[filename] references
- Match filenames to existing media nodes and preserve their IDs
- Alternatively, preserve all existing media nodes and append them to the new content
Implementation Notes
- The
!media[id] syntax currently expects a media ID, but users don't know these IDs
- Could support
!media[filename.png] that looks up the ID from existing description media
- Or automatically append all existing media to the end of updated descriptions
Context
An embedded screenshot in NX-14990 was permanently lost when updating the description with new content.
Problem
When editing an issue description, embedded media (images uploaded directly to the description) are lost because the entire ADF is replaced. These media elements have collection/ID references to Jira's media service that cannot be recreated from the filename alone.
Example of lost media:
{ "type": "mediaSingle", "content": [{ "type": "media", "attrs": { "id": "abc-123-media-id", "collection": "contentId-12345", "type": "file" } }] }Proposed Solution
When editing a description:
mediaSingle/medianodes!media[filename]referencesImplementation Notes
!media[id]syntax currently expects a media ID, but users don't know these IDs!media[filename.png]that looks up the ID from existing description mediaContext
An embedded screenshot in NX-14990 was permanently lost when updating the description with new content.