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

Wiki Markup conversion context

Technical GuideConversion

In the simple example, we did not need any additional information to convert Wiki Markup to ADF. However, this is often not enough information for a correct conversion because Wiki Markup and ADF represent some items very differently. Since Wiki Markup is meant to be written by humans, it usually has human-readable references to people, media attachments, and Jira issue keys. Successful conversion of these items requires a mapping of these to the identifiers and Jira site links that ADF requires.

Harder Example

Wiki

1
2
3
4
5
6
7
8
9
Hello, [~crf]!

I took a couple of screenshots of the problem... Could you take a look at them?

* !screenshot1.png|thumbnail!
* !screenshot2.png|thumbnail!

Also, I think JRASERVER-9 might be a duplicate...

Since this Wiki Markup includes attachments, a mention, and an issue key, we need to provide additional information through the conversion context. First, let's see what happens if no conversion context is provided:

Java

1
2
3
4
5
        AdfJackson2 adfJackson2 = new AdfJackson2();
        WikiMarkupTransformer transformer = WikiMarkupTransformer.using(adfJackson2.jsonParser());
        Doc adf = transformer.parse(wiki);
        System.out.println(adfJackson2.pretty().marshall(adf));

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  "type" : "doc",
  "version" : 1,
  "content" : [ {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "Hello, "
    }, {
      "type" : "mention",
      "attrs" : {
        "id" : "crf"
      }
    }, {
      "type" : "text",
      "text" : "!"
    } ]
  }, {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "I took a couple of screenshots of the problem... Could you take a look at them?"
    } ]
  }, {
    "type" : "bulletList",
    "content" : [ {
      "type" : "listItem",
      "content" : [ {
        "type" : "mediaSingle",
        "content" : [ {
          "type" : "media",
          "attrs" : {
            "type" : "file",
            "id" : "screenshot1.png",
            "collection" : "",
            "width" : 200,
            "height" : 183
          }
        } ],
        "attrs" : {
          "layout" : "center"
        }
      } ]
    }, {
      "type" : "listItem",
      "content" : [ {
        "type" : "mediaSingle",
        "content" : [ {
          "type" : "media",
          "attrs" : {
            "type" : "file",
            "id" : "screenshot2.png",
            "collection" : "",
            "width" : 200,
            "height" : 183
          }
        } ],
        "attrs" : {
          "layout" : "center"
        }
      } ]
    } ]
  }, {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "Also, I think JRASERVER-9 might be a duplicate..."
    } ]
  } ]
}

There are several problems with the resulting ADF:

  1. The mention node has crf as its id. This is not what an Atlassian Account ID normally looks like. It should probably be something more like 123456:8d913e2b-5621-4180-b6f9-b45a156f6e5a. This means that the mention node will not work. This happened because the conversion context did not have a mapping for mentions of the user crf, so it just left it alone.
  2. The problem for the media nodes is similar. Since they don't have mappings in the conversion context, the attachment's filename is retained as the Media ID, which of course should normally be a UUID instead.
  3. The issue key is not mapped either, and in this case it is left as plain text when it should be turned into an inlineCard node instead.

Specifying a Conversion Context

Provided we know about this problem in advance, we can avoid it by providing these values to the conversion context before we request the conversion. That would look like this:

Java

1
2
3
4
5
6
7
8
9
10
        AdfJackson2 adfJackson2 = new AdfJackson2();
        WikiMarkupTransformer transformer = WikiMarkupTransformer.using(adfJackson2.jsonParser());
        transformer.context().conversion()
                .mention("crf", "123456:8d913e2b-5621-4180-b6f9-b45a156f6e5a")
                .media("screenshot1.png", "f2e12587-44fc-4407-9544-78dbf565a0d3")
                .media("screenshot2.png", "e581b41b-c21f-47f3-b48f-2f509d0143d1")
                .inlineCard("JRASERVER-9", "https://jira.atlassian.com/browse/JRASERVER-9");
        Doc adf = transformer.parse(wiki);
        System.out.println(adfJackson2.pretty().marshall(adf));

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
  "type" : "doc",
  "version" : 1,
  "content" : [ {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "Hello, "
    }, {
      "type" : "mention",
      "attrs" : {
        "id" : "123456:8d913e2b-5621-4180-b6f9-b45a156f6e5a"
      }
    }, {
      "type" : "text",
      "text" : "!"
    } ]
  }, {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "I took a couple of screenshots of the problem... Could you take a look at them?"
    } ]
  }, {
    "type" : "bulletList",
    "content" : [ {
      "type" : "listItem",
      "content" : [ {
        "type" : "mediaSingle",
        "content" : [ {
          "type" : "media",
          "attrs" : {
            "type" : "file",
            "id" : "f2e12587-44fc-4407-9544-78dbf565a0d3",
            "collection" : "",
            "width" : 200,
            "height" : 183
          }
        } ],
        "attrs" : {
          "layout" : "center"
        }
      } ]
    }, {
      "type" : "listItem",
      "content" : [ {
        "type" : "mediaSingle",
        "content" : [ {
          "type" : "media",
          "attrs" : {
            "type" : "file",
            "id" : "e581b41b-c21f-47f3-b48f-2f509d0143d1",
            "collection" : "",
            "width" : 200,
            "height" : 183
          }
        } ],
        "attrs" : {
          "layout" : "center"
        }
      } ]
    } ]
  }, {
    "type" : "paragraph",
    "content" : [ {
      "type" : "text",
      "text" : "Also, I think "
    }, {
      "type" : "inlineCard",
      "attrs" : {
        "url" : "https://jira.atlassian.com/browse/JRASERVER-9#icft=JRASERVER-9"
      }
    }, {
      "type" : "text",
      "text" : " might be a duplicate..."
    } ]
  } ]
}

Now the mention and media nodes get their respective mapped IDs and the issue key is correctly replaced with an inlineCard.

Converting ADF back to Wiki Markup

The process is similar for conversions in the reverse direction. Note that in this direction the inline card information does not need to be specified and that there are some differences from the original Wiki Markup. These differences are expected.

Java

1
2
3
4
5
6
7
        transformer.context().conversion()
                .mention("123456:8d913e2b-5621-4180-b6f9-b45a156f6e5a", "crf")
                .media("f2e12587-44fc-4407-9544-78dbf565a0d3", "screenshot1.png")
                .media("e581b41b-c21f-47f3-b48f-2f509d0143d1", "screenshot2.png");
        String roundTrip = transformer.encode(adf);
        System.out.println(roundTrip);

Wiki Markup

1
2
3
4
5
6
7
8
9
Hello, [~crf]!

I took a couple of screenshots of the problem... Could you take a look at them?

* !screenshot1.png|width=200,height=183!
* !screenshot2.png|width=200,height=183!

Also, I think [JRASERVER-9] might be a duplicate...

Rate this page: