Skip to content

jtk issues update --description silently drops media nodes from the stored description #488

Closed

Description

@zzwong

Summary

jtk issues update --description builds a fresh ADF document from the input text and PUTs it, replacing the stored description wholesale. Any mediaSingle/mediaGroup nodes in the stored description — attached images — are silently deleted, with a green exit.

Environment

  • jtk version tested: 1.3.169
  • Jira: Cloud
  • Date tested: 2026-09-03

Reproduction

Attach an image to a placeholder issue and reference it from the description, so the stored ADF contains a mediaSingle node:

POST /rest/api/3/issue/PROJ-1/attachments   # upload image.png
PUT  /rest/api/2/issue/PROJ-1               # description: "Original description text.\n\n!image.png|width=1,height=1!"

Confirm the stored v3 ADF now contains the media node:

GET /rest/api/3/issue/PROJ-1?fields=description
{
  "type": "doc",
  "version": 1,
  "content": [
    { "type": "paragraph", "content": [{ "type": "text", "text": "Original description text." }] },
    {
      "type": "mediaSingle",
      "attrs": { "layout": "center" },
      "content": [
        { "type": "media", "attrs": { "type": "file", "id": "<media-uuid>", "alt": "image.png", "collection": "", "height": 1, "width": 1 } }
      ]
    }
  ]
}

Now replace only the text through jtk:

jtk issues update PROJ-1 --description "Replacement text only."
GET /rest/api/3/issue/PROJ-1?fields=description

Expected behavior

Replacing the description text preserves the stored media nodes.

The preservation requires reading the current description first; if that read fails, the command must fail closed — contextual error, no PUT — rather than fall back to writing a media-less replacement (a transient read failure must never delete media).

Actual behavior

The command exits 0 and prints the usual success view with the new description. The mediaSingle node is gone from the stored ADF:

{
  "type": "doc",
  "version": 1,
  "content": [
    { "type": "paragraph", "content": [{ "type": "text", "text": "Replacement text only." }] }
  ]
}

Nothing in the output indicates that content was removed.

Notes

The uploaded file itself survives — it remains in the issue's attachment array and is still reachable from the attachments panel. What is destroyed is the inline reference, so the image silently disappears from the rendered description while the orphaned attachment stays behind. Recovering it means re-authoring the media node by hand with the original media UUID.

Status

Still reproduces on 1.3.169, verified 2026-09-03 against Jira Cloud with the reproduction above. The version at original reporting time was not recorded.

Related

Activity

  1. added a commit that references this issue on Sep 30, 2026
    519dca4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions