# Attachment links in Jira: [^file] in wiki markup and ADF

URL: https://goingstellar.ro/reference/jira-formatting/attachment-links/

[^name.ext] links to a file attached to the current work item. ADF stores attachments as media nodes in a mediaGroup, and an ADF media node needs a real file id from the media service.

## Wiki markup

```
[^attachment.ext]
```

## Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for `[^attachment.ext]`:

```json
{
 "type": "doc",
 "version": 1,
 "content": [
  {
   "type": "mediaGroup",
   "content": [
    {
     "type": "media",
     "attrs": {
      "type": "file",
      "id": "UNKNOWN_MEDIA_attachment.ext",
      "collection": ""
     }
    }
   ]
  }
 ]
}
```

## Examples

Wiki markup (API v2):

```
[#anchor]
```

A same-page link, shown for comparison. It needs no attachment, so it renders as a link.

Rendered by Jira (HTML):

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

Back to wiki after the round trip:

```
[#anchor|#anchor]
```

Sent to Jira Cloud on 29 Nov 2026.

Wiki markup (API v2):

```
[Anchor link|#anchorname]
```

The same form with an alias.

Rendered by Jira (HTML):

```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 29 Nov 2026.

Wiki markup (API v2):

```
[Atlassian|http://atlassian.com]
```

An external link with an alias, as an alternative when the file is hosted elsewhere.

Rendered by Jira (HTML):

```html
<p><a href="http://atlassian.com" class="external-link" rel="nofollow noreferrer">Atlassian</a></p>
```

Back to wiki after the round trip:

```
[Atlassian|http://atlassian.com]
```

Sent to Jira Cloud on 29 Nov 2026.

## What changes in conversion

- The probe for [^attachment.ext] ran on a work item with no attachment of that name. Jira rendered an error span and stored a mediaGroup with a placeholder id.
- Sending that stored ADF back through v3 was rejected with ATTACHMENT_VALIDATION_ERROR, so an attachment link cannot be rebuilt from the placeholder.
- The link text of an attachment link in the editor depends on the media service, which wiki markup cannot reproduce.

## Pitfalls

- The attachment must exist on the same work item before the link is rendered. Otherwise the rendered text is an error.
- The link points to an attachment of the current work item only. Attachments on other work items need a full URL.

## Related

- [{anchor} and [#anchor]](https://goingstellar.ro/reference/jira-formatting/anchor-links/)
- [[alias|url] external links](https://goingstellar.ro/reference/jira-formatting/external-links/)
- [[file:///] links](https://goingstellar.ro/reference/jira-formatting/file-links/)
- [Embedded video and audio](https://goingstellar.ro/reference/jira-formatting/embedded-media/)
- [!image! images](https://goingstellar.ro/reference/jira-formatting/images/)

## Sources

- [Text Formatting Notation Help (Jira, in-product help)](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all)
- [Atlassian Document Format: document structure (Jira Cloud platform)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)

