Home/Jira formatting reference
Jira text formatting
Embedded video and audio in Jira wiki markup and ADF
The wiki help lists !quicktime.mov!, !quicktime.mov|width=300,height=400! and similar lines to embed Flash, QuickTime, Windows Media, Real Media and MP3 files. Each one needs an attached file. On Cloud, the stored form is a media node.
Wiki markup
!quicktime.mov!
!quicktime.mov|width=300,height=400!
!spaceKey:pageTitle^attachment.mov!
!media.wmv|id=media!
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)
!https://example.com/logo.png|width=200!Embed by URL with a single dimension. The media node is stored as external.
Rendered by Jira (HTML)
<p><span class="image-wrap" style=""><img src="https://example.com/logo.png" width="200" style="border: 0px solid black" /></span></p>Back to wiki after the round trip
!https://example.com/logo.png|width=200,height=183!Sent to Jira Cloud on .
Wiki markup (API v2)
!https://example.com/logo.png|width=200,height=100!Embed by URL with both dimensions, the same attributes the help gives for a video (width=300,height=400).
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 .
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 a media node through v3. External media is the only kind that can exist without an attachment.
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
- The probes for
!quicktime.mov!and!quicktime.mov|width=300,height=400!had no attachment, so they rendered the 'File (quicktime.mov) not found' error and could not be written back (ATTACHMENT_VALIDATION_ERROR). That is a limit of the test, not a difference from the documentation. - Both were still stored as
mediaSinglewith afilemedia node and idUNKNOWN_MEDIA_quicktime.mov. The second kept width 300 and height 400; the first got the 200 by 183 placeholder. - v2 returns the original wiki text for these lines. The three external examples above are the ones that complete the wiki to ADF to wiki round trip.
- According to the ADF documentation, a media node needs width and height inside
mediaSingle, or it is not displayed.
Pitfalls
- The help says other file types may need
classid,codebaseandpluginspageproperties; none of these were probed. - The file must be attached to the work item under the exact name used in the markup.
- The ADF
medianode of type file needs a Media Services id and collection; those cannot be made up in a REST call.