Home/Jira formatting reference
Jira text formatting
Jira REST API v2 wiki markup vs v3 ADF: what each reads
REST API v2 takes and returns wiki markup in text fields. REST API v3 takes and returns ADF, the JSON Jira stores. A comment is saved once; v2 converts it to wiki on every read, and anything wiki cannot say is dropped or rewritten.
Wiki markup
There is no wiki markup for this element.
Stored as ADF (REST API v3)
The ADF document Jira Cloud stores for ADF:{"content": [{"content": [{"marks": [{"type": "strong"}], "text": "bold", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "em"}], "text": "ital", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "underline"}], "text": "u", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "strike"}], "text": "s", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "code"}], "text": "c", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "bold",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": " "
},
{
"type": "text",
"text": "ital",
"marks": [
{
"type": "em"
}
]
},
{
"type": "text",
"text": " "
},
{
"type": "text",
"text": "u",
"marks": [
{
"type": "underline"
}
]
},
{
"type": "text",
"text": " "
},
{
"type": "text",
"text": "s",
"marks": [
{
"type": "strike"
}
]
},
{
"type": "text",
"text": " "
},
{
"type": "text",
"text": "c",
"marks": [
{
"type": "code"
}
]
}
]
}
]
}
Examples
Wiki markup (API v2)
{panel:title=My Title|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE}
a block of text surrounded with a *panel*
yet _another_ line
{panel}Panel options sent as wiki. The v2 render keeps them; after the stored ADF is read as wiki, only a title line and one colour remain.
Rendered by Jira (HTML)
<div class="panel" style="background-color: #FFFFCE;border-color: #ccc;border-style: dashed;border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #ccc;background-color: #F7D6C1;"><b>My Title</b></div><div class="panelContent" style="background-color: #FFFFCE;">
<p>a block of text surrounded with a <b>panel</b><br/>
yet <em>another</em> line</p>
</div></div>Back to wiki after the round trip
{panel:bgColor=#fffae6}
*My Title*
a block of text surrounded with a *panel*
yet _another_ line
{panel}Sent to Jira Cloud on .
Wiki markup (API v2)
{code:bash|title=install.sh}
npm install
{code}A code macro with a title. The title becomes a bold paragraph and bash is replaced by java on the way back.
Rendered by Jira (HTML)
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>install.sh</b></div><div class="codeContent panelContent">
<pre class="code-bash">npm install
</pre>
</div></div>Back to wiki after the round trip
*install.sh*
{code:java}npm install{code}Sent to Jira Cloud on .
Wiki markup (API v2)
||H1||H2||
|*bold* cell|{{code}} cell|
|[link|https://example.com]|line\\break|A table with inline formatting. Header cells come back wrapped in bold, and the manual break becomes a real new line.
Rendered by Jira (HTML)
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>H1</th>
<th class='confluenceTh'>H2</th>
</tr>
<tr>
<td class='confluenceTd'><b>bold</b> cell</td>
<td class='confluenceTd'><tt>code</tt> cell</td>
</tr>
<tr>
<td class='confluenceTd'><a href="https://example.com" class="external-link" rel="nofollow noreferrer">link</a></td>
<td class='confluenceTd'>line<br class="atl-forced-newline" />break</td>
</tr>
</tbody></table>
</div>
Back to wiki after the round trip
||*H1*||*H2*||
|*bold* cell|{{code}} cell|
|[link|https://example.com]|line
break|Sent to Jira Cloud on .
ADF (API v3)
{"content": [{"content": [{"marks": [{"attrs": {"color": "#fedec8"}, "type": "backgroundColor"}], "text": "highlight", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}Sends a highlight colour through v3. v2 has no equivalent and writes plain text.
Rendered by Jira (HTML)
<p>highlight</p>Back to wiki after the round trip
highlightSent to Jira Cloud on .
ADF (API v3)
{"content": [{"content": [{"content": [{"content": [{"attrs": {"title": "More"}, "content": [{"content": [{"text": "inside", "type": "text"}], "type": "paragraph"}], "type": "nestedExpand"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}Sends a node that wiki cannot express. v2 writes it as raw JSON in an {adf} block.
Rendered by Jira (HTML)
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'><!-- ADF macro (type = 'nestedExpand') --></td>
</tr>
</tbody></table>
</div>
Back to wiki after the round trip
|{adf:display=block}
{"type":"nestedExpand","attrs":{"title":"More"},"content":[{"type":"paragraph","content":[{"type":"text","text":"inside"}]}]}
{adf}|Sent to Jira Cloud on .
ADF (API v3)
{"content": [{"content": [{"attrs": {"url": "https://example.com"}, "type": "inlineCard"}], "type": "paragraph"}], "type": "doc", "version": 1}Sends a smart link. v2 reads it as a link with the title smart-link.
Rendered by Jira (HTML)
<p><a href="https://example.com" title="smart-link" class="external-link" rel="nofollow noreferrer">https://example.com</a></p>Back to wiki after the round trip
[https://example.com|https://example.com|smart-link]Sent to Jira Cloud on .
ADF (API v3)
{"content": [{"content": [{"attrs": {"color": "blue", "text": "IN PROGRESS"}, "type": "status"}], "type": "paragraph"}], "type": "doc", "version": 1}Sends a status lozenge. v2 reads it as coloured bold text.
Rendered by Jira (HTML)
<p><font color="#00B8D9"><b>[ IN PROGRESS ]</b></font></p>Back to wiki after the round trip
{color:#00B8D9}*[ IN PROGRESS ]*{color}Sent to Jira Cloud on .
What changes in conversion
- A comment is stored once as ADF. v2 turns it into wiki on read, and v2 turns wiki into ADF on write. Writing back what you read changes the stored comment.
- Lost when going through wiki: panel borders and title colours, code titles as titles, languages outside the supported list, cell and text background colours, and collapsible sections.
- ADF-only nodes are written by v2 in different ways: a status as coloured bold text, a date as {{2026-12-01}}, an expand as a bold title, a smart link as [url|url|smart-link], and a nested expand as an {adf:display=block} block holding the node as JSON.
- Marks are limited in ADF. The code mark can be combined only with link: a code mark with a link was accepted and written as {{[code link|https://example.com]}}, while a code mark with strong was rejected by v3 with INVALID_INPUT.
Pitfalls
- Do not edit a comment through v2 if it contains ADF-only content. The write replaces the stored ADF with what wiki can say.
- A v2 comment that looks fine in the render can still be changed by the round trip. Compare the stored ADF.
- In v3, validate marks before sending. An invalid combination fails with
INVALID_INPUTand gives no detail. - {info}, {expand} and {status} typed as wiki stay as text in both APIs.
Questions and answers
Why does a v2 comment lose formatting after I edit it in the editor?
The editor saves ADF. When v2 reads that ADF as wiki, anything wiki cannot express is dropped or flattened, so a read followed by a write can change the stored comment.
Related
- Markdown in Jira Cloud
- {panel} macro
- {code} macro
- Expand (collapsible section)
- Status lozenge
- Macros that do not convert