Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Sep 1, 2026

ADF node: media

Node

Description

The media node represents a single file or link stored in media services. Alternatively, it can also represent a link to an external media resource.1

Example

Java

1
2
3
4
5
6
7
8
9
Media.fileMedia(
        "6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5",
        "my project files"
)
        .size(200, 183)
        .linkMark("https://developer.atlassian.com/")
        .border(2, "#091e4224")
        .mark(inlineComment("c4cbe18e-9902-4734-bf9b-1426a81ef785"));

Or equivalently:

1
2
3
4
5
6
7
8
9
Media.media()
        .file()
        .id("6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5")
        .collection("my project files")
        .size(200, 183)
        .linkMark("https://developer.atlassian.com/")
        .border(2, "#091e4224")
        .mark(inlineComment("c4cbe18e-9902-4734-bf9b-1426a81ef785"));

ADF

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "type": "media",
  "attrs": {
    "id": "6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5",
    "collection": "my project files",
    "type": "file",
    "width": 200,
    "height": 183
  },
  "marks": [
    {
      "type": "link",
      "attrs": {
        "href": "https://developer.atlassian.com/"
      }
    },
    {
      "type": "border",
      "attrs": {
        "color": "#091e4224",
        "size": 2
      }
    },
    {
      "type": "annotation",
      "attrs": {
        "id": "c4cbe18e-9902-4734-bf9b-1426a81ef785",
        "annotationType": "inlineComment"
      }
    }
  ]
}

Result

Note: The image border is not shown in this example.

Screenshot example

Compatibility

Products

ConfluenceJira

Nodes

Marks

Structure

  • type - media
  • attrs (file or link)
    • type - file | link2
    • alt? - string
    • collection - string3
    • height? - number
    • id - string (not empty)
    • occurrenceKey? - string (not empty)
    • width? - number
    • localId? – string4
  • marks? - array(link | border | annotation …)

With type attribute set to external5

  • type - media
  • attrs
    • type - external6
    • alt? - string
    • height? - number
    • width? - number
    • url - string (URI)
    • localId? – string7
  • marks? - array(link | border | annotation …)

  1. Most of the support for link media no longer functions in the editor code base, so clients are unlikely to encounter it in the wild and should not use it in new ADF.↩︎
  2. Most of the support for link media no longer functions in the editor code base, so clients are unlikely to encounter it in the wild and should not use it in new ADF.↩︎
  3. Media collections are being phased out, but the collection ID is still required by the schema. In Jira, it is also used for the temporary collections that exist as part of creating a new issue, and the names follow special naming conventions related to the user and/or field that the image is associated with. Unless you really know what you are doing, you should probably use "", which this library uses by default.↩︎
  4. The localId, when present, will typically be a random UUID. This is not enforced by the schema.↩︎
  5. There is very little documentation available for media with a type of external, even internally at Atlassian. This documentation will be improved once that information is available. Your humble documentation author has only seen it used in cases where there was a problem accessing the underlying image, resulting in problems uploading its contents to the Media API.↩︎
  6. There is very little documentation available for media with a type of external, even internally at Atlassian. This documentation will be improved once that information is available. Your humble documentation author has only seen it used in cases where there was a problem accessing the underlying image, resulting in problems uploading its contents to the Media API.↩︎
  7. The localId, when present, will typically be a random UUID. This is not enforced by the schema.↩︎

Rate this page: