Going Stellar

Home/Jira formatting reference

Jira text formatting

Anchors in Jira: {anchor} and [#anchor] in wiki and ADF

{anchor:name} places a bookmark, and [#name] or [alias|#name] links to it on the same page. Jira renders both in wiki markup, but ADF has no anchor node, so the bookmark does not survive being saved through ADF.

Wiki markup

{anchor:name}
[#name]
[alias|#name]

Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for [#anchor]:

{
 "type": "doc",
 "version": 1,
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "text",
     "text": "#anchor",
     "marks": [
      {
       "type": "link",
       "attrs": {
        "href": "#anchor"
       }
      }
     ]
    }
   ]
  }
 ]
}

Examples

Wiki markup (API v2)

[#anchor]

Link to a bookmark on the same page with no alias.

Rendered by Jira (HTML)

<p><a href="#anchor" rel="noreferrer">anchor</a></p>

Back to wiki after the round trip

[#anchor|#anchor]

Sent to Jira Cloud on .

Wiki markup (API v2)

[Anchor link|#anchorname]

Give the same-page link a readable label.

Rendered by Jira (HTML)

<p><a href="#anchorname" rel="noreferrer">Anchor link</a></p>

Back to wiki after the round trip

[Anchor link|#anchorname]

Sent to Jira Cloud on .

Wiki markup (API v2)

\[not a link\]

Show literal square brackets by escaping them, so [#anchor]-like text is not read as a link.

Rendered by Jira (HTML)

<p>[not a link]</p>

Back to wiki after the round trip

[not a link]

Sent to Jira Cloud on .

What changes in conversion

  • {anchor:name} renders as an empty named anchor in the v2 HTML, but the stored ADF for it is an empty paragraph. Sending that empty ADF back is rejected as an empty comment body.
  • [#anchor] becomes a link mark with the href #anchor. The ADF text is #anchor, and a wiki read returns [#anchor|#anchor].
  • [alias|#name] survives the round trip unchanged.

Pitfalls

  • Do not use an anchor as the only content of a comment. The stored ADF is empty, and writing it back fails.
  • The text of [#name] after a round trip is #name, so give links an alias if the label matters.

Sources

  1. Text Formatting Notation Help (Jira, in-product help)
  2. Confluence wiki markup (Atlassian Documentation)
  3. Atlassian Document Format: document structure (Jira Cloud platform)

Markdown version · All formatting pages