Home/Jira formatting reference
Jira text formatting
Headings in Jira: h1. to h6. wiki markup, Markdown, ADF
A heading is a line that starts with h1. to h6. in wiki markup, # to ###### in the Cloud editor (per the Atlassian documentation) and a heading node with a level from 1 to 6 in ADF. Use headings to give long descriptions and comments a structure that people can scan. Levels 1 to 6 survive the wiki to ADF to wiki round trip unchanged.
Wiki markup
h1. Biggest heading
h2. Bigger heading
h3. Big heading
h4. Normal heading
h5. Small heading
h6. Smallest heading
Markdown shortcuts in the editor
Per the Atlassian documentation, not tested.
| Type | What happens |
|---|---|
# to ###### | Converts to a heading of level 1 to 6 as you type in the editor, per the Atlassian documentation. |
Stored as ADF (REST API v3)
The ADF document Jira Cloud stores for h2. *Bold* heading with {{code}}:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "heading",
"attrs": {
"level": 2
},
"content": [
{
"type": "text",
"text": "Bold",
"marks": [
{
"type": "strong"
}
]
},
{
"type": "text",
"text": " heading with "
},
{
"type": "text",
"text": "code",
"marks": [
{
"type": "code"
}
]
}
]
}
]
}
Examples
Wiki markup (API v2)
h1. Biggest headingThe top level. Jira renders an h1 element and adds an anchor named after the text with spaces removed.
Rendered by Jira (HTML)
<h1><a name="Biggestheading"></a>Biggest heading</h1>Back to wiki after the round trip
h1. Biggest headingSent to Jira Cloud on .
Wiki markup (API v2)
h6. Smallest headingThe lowest level the notation supports.
Rendered by Jira (HTML)
<h6><a name="Smallestheading"></a>Smallest heading</h6>Back to wiki after the round trip
h6. Smallest headingSent to Jira Cloud on .
Wiki markup (API v2)
h2.No spaceThe help text says to put a space after the dot. Jira accepts the heading without it and writes the space back when the field is read again.
Rendered by Jira (HTML)
<h2><a name="Nospace"></a>No space</h2>Back to wiki after the round trip
h2. No spaceSent to Jira Cloud on .
Wiki markup (API v2)
h2. Indented headingLeading spaces do not stop the heading from being recognised, and they are dropped on the way back.
Rendered by Jira (HTML)
<h2><a name="Indentedheading"></a>Indented heading</h2>Back to wiki after the round trip
h2. Indented headingSent to Jira Cloud on .
Wiki markup (API v2)
h2. *Bold* heading with {{code}}Inline formatting works inside a heading. In ADF the heading holds text nodes with strong and code marks.
Rendered by Jira (HTML)
<h2><a name="Boldheadingwith%7B%7Bcode%7D%7D"></a><b>Bold</b> heading with <tt>code</tt></h2>Back to wiki after the round trip
h2. *Bold* heading with {{code}}Sent to Jira Cloud on .
Wiki markup (API v2)
h7. SeventhOnly levels 1 to 6 exist. A seventh level is plain paragraph text.
Rendered by Jira (HTML)
<p>h7. Seventh</p>Back to wiki after the round trip
h7. SeventhSent to Jira Cloud on .
Wiki markup (API v2)
## Markdown h2Markdown heading syntax sent as wiki input is read as a numbered list, not as a heading.
Rendered by Jira (HTML)
<ol>
<li>
<ol>
<li>Markdown h2</li>
</ol>
</li>
</ol>
Back to wiki after the round trip
#
## Markdown h2Sent to Jira Cloud on .
What changes in conversion
- h1. to h6. map to a heading node with attrs.level 1 to 6 and come back from ADF as the same h1. to h6. line.
- The wiki text is normalised on the way back: h2.No space becomes h2. No space and leading spaces before h2. disappear.
- Bold, italic and monospace inside a heading are kept as marks and come back as *Bold* and {{code}}.
- The ADF alignment mark can sit on a heading. Wiki markup has no syntax for it, so the wiki read-back is plain hN. text (see alignment-indentation).
- Markdown heading lines sent through the API are not converted: # text is a numbered list item in wiki markup, and ## text becomes a nested list whose first item is empty.
Where the documentation differs
h2.No spaceSent to Jira Cloud, : the documentation says The Jira help says to place hn. followed by a space at the start of the line., the actual result is h2.No space (no space) rendered as an h2 heading as well..
Pitfalls
- The generated anchor is the heading text without spaces, with other characters percent-encoded, for example
Boldheadingwith%7B%7Bcode%7D%7D. h7.and higher are not headings. They stay as visible text.#is the numbered list marker in wiki markup. Pasting Markdown headings into a v2 API call produces lists.
Questions and answers
How many heading levels does Jira support?
Six. h1. to h6. in wiki markup, and level 1 to 6 on the ADF heading node.