Going Stellar

Home/Jira formatting reference

Jira text formatting

Images in Jira: !image! wiki markup and ADF media

A line that is only !url! becomes an image. A URL is shown from the remote source, a bare file name points at an attachment. Wiki markup supports it on Server, Data Center and the Cloud REST API v2. Cloud stores it as a mediaSingle node in ADF.

Wiki markup

!http://www.host.com/image.gif!
!attached-image.gif!
!https://example.com/logo.png|alt=Company logo!

Markdown shortcuts in the editor

Per the Atlassian documentation, not tested.

TypeWhat happens
![alt text](http://example.com/image/example.png)Listed as 'Image (from URL)' in the Atlassian Markdown shortcut table, per the Atlassian documentation. The editor converts it as you type; it is not a stored format.

Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for ADF:{"content": [{"attrs": {"layout": "center"}, "content": [{"attrs": {"height": 100, "type": "external", "url": "https://example.com/logo.png", "width": 200}, "type": "media"}], "type": "mediaSingle"}], "type": "doc", "version": 1}:

{
 "type": "doc",
 "version": 1,
 "content": [
  {
   "type": "mediaSingle",
   "attrs": {
    "layout": "center"
   },
   "content": [
    {
     "type": "media",
     "attrs": {
      "type": "external",
      "url": "https://example.com/logo.png",
      "height": 100,
      "width": 200
     }
    }
   ]
  }
 ]
}

Examples

Wiki markup (API v2)

!http://www.host.com/image.gif!

Show a screenshot hosted elsewhere inside a comment or description. The remote URL is used directly.

Rendered by Jira (HTML)

<p><span class="image-wrap" style=""><img src="http://www.host.com/image.gif" style="border: 0px solid black" /></span></p>

Back to wiki after the round trip

!http://www.host.com/image.gif|width=200,height=183!

Sent to Jira Cloud on .

Wiki markup (API v2)

!https://example.com/logo.png|alt=Company logo!

Give the image a text alternative. The alt value survives in the stored ADF and in the HTML.

Rendered by Jira (HTML)

<p><span class="image-wrap" style=""><img src="https://example.com/logo.png" alt="Company logo" style="border: 0px solid black" /></span></p>

Back to wiki after the round trip

!https://example.com/logo.png|width=200,height=183,alt="Company logo"!

Sent to Jira Cloud on .

ADF (API v3)

{"content": [{"attrs": {"layout": "center"}, "content": [{"attrs": {"height": 100, "type": "external", "url": "https://example.com/logo.png", "width": 200}, "type": "media"}], "type": "mediaSingle"}], "type": "doc", "version": 1}

Write the image through REST API v3 with a mediaSingle node of type external. v2 reads it back as plain wiki markup.

Rendered by Jira (HTML)

<p><span class="image-wrap" style=""><img src="https://example.com/logo.png" height="100" width="200" style="border: 0px solid black" /></span></p>

Back to wiki after the round trip

!https://example.com/logo.png|width=200,height=100!

Sent to Jira Cloud on .

What changes in conversion

  • An external image becomes mediaSingle with a media child of type external and the URL. The layout is always center in these runs.
  • When the markup gives no size, Jira stores width 200 and height 183, which is not the real size of the picture. Sent back as wiki, the image then carries |width=200,height=183.
  • A bare file name such as attached-image.gif becomes a file media node with an id of the form UNKNOWN_MEDIA_attached-image.gif and an empty collection when no such attachment exists. That stored ADF could not be written back as a comment (the API answered ATTACHMENT_VALIDATION_ERROR).
  • Markdown image syntax sent through the API is not an image: ![alt](https://example.com/a.png) rendered as literal text with a link. Only the editor converts it while typing.

Pitfalls

  • !file.png! only works when the work item has an attachment with exactly that name. Otherwise the comment shows an 'Unable to render embedded object' error.
  • The stored size is a placeholder (200 by 183) unless you set width and height yourself.
  • Markdown image syntax sent as wiki input is not parsed; it shows as literal text.

Sources

  1. Text Formatting Notation Help (Jira, in-product help)
  2. Markdown and keyboard shortcuts (Atlassian Support, Jira Cloud)
  3. Atlassian Document Format: document structure (Jira Cloud platform)

Markdown version · All formatting pages