Home/Confluence storage format reference
Confluence storage format
jira and jirachart macros in Confluence storage format
The jira macro shows one issue by key or a table of issues from a JQL query, and jirachart draws a chart from a JQL query. Both are body-less ac:structured-macro elements. The Cloud documentation calls the first one Jira work items.
Storage format
<ac:structured-macro ac:name="jira"><ac:parameter ac:name="key">WEB-1</ac:parameter></ac:structured-macro>
<ac:structured-macro ac:name="jira"><ac:parameter ac:name="jqlQuery">project = WEB</ac:parameter><ac:parameter ac:name="maximumIssues">20</ac:parameter><ac:parameter ac:name="columns">key,summary,status</ac:parameter></ac:structured-macro>
<ac:structured-macro ac:name="jirachart"><ac:parameter ac:name="jql">project = WEB</ac:parameter></ac:structured-macro>
In the editor
| How | Note |
|---|---|
| Type /jira and select Jira work items, or use the + toolbar button | Per the Atlassian documentation. |
| Paste a Jira work item URL; Confluence converts it to the macro | Per the Atlassian documentation. |
| Use the + toolbar button or type / and pick the Jira chart macro | Per the Atlassian documentation. |
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<ac:structured-macro ac:name="jira"><ac:parameter ac:name="jqlQuery">project = WEB</ac:parameter><ac:parameter ac:name="maximumIssues">20</ac:parameter><ac:parameter ac:name="columns">key,summary,status</ac:parameter></ac:structured-macro>
{
"type": "doc",
"content": [
{
"type": "extension",
"attrs": {
"layout": "full-width",
"extensionType": "com.atlassian.confluence.macro.core",
"extensionKey": "jira",
"parameters": {
"macroParams": {
"_parentId": {
"value": "<page id>"
},
"maximumIssues": {
"value": "20"
},
"columns": {
"value": "key,summary,status"
},
"jqlQuery": {
"value": "project = WEB"
}
},
"macroMetadata": {
"macroId": {
"value": "<id>"
},
"schemaVersion": {
"value": "1"
},
"placeholder": [
{
"type": "image",
"data": {
"url": "https://your-site.atlassian.net/wiki/download/resources/confluence.extra.jira/jira-table.png"
}
}
],
"title": "Jira Legacy"
}
}
}
}
],
"version": 1
}
Examples
Storage format sent
<ac:structured-macro ac:name="jirachart"><ac:parameter ac:name="jql">project = WEB</ac:parameter></ac:structured-macro>Asks for a chart from a JQL query. The probe stored the jql parameter unchanged, and the view was a warning message instead of a chart.
Rendered view (HTML)
<span class="aui-message aui-message-warning jim-error-message jim-error-message-single conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="jirachart">
<span class="icon-in-pdf"> </span>
The chart is not supported.
</span>Storage format after the round trip through ADF
<ac:structured-macro ac:name="jirachart" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="jql">project = WEB</ac:parameter></ac:structured-macro>Sent to Confluence Cloud on .
Storage format sent
<p><ac:link><ri:shortcut ri:key="jira" ri:parameter="ABC-123" /></ac:link></p>A Jira shortcut link, written as an ri:shortcut with the key jira and the parameter ABC-123. It is a link, not the jira macro, and the ADF round trip rewrote it to an unnamed link that points at a 404 URL of the site.
Rendered view (HTML)
<p><a class="unresolved" href="#">ABC-123@jira</a></p>Storage format after the round trip through ADF
<p><a href="https://your-site.atlassian.net/wiki/404?key%3Djira%3Bsearch%3Fq%3DABC-123">unnamed link</a></p>Sent to Confluence Cloud on .
Storage format sent
<p><a href="https://example.com" data-card-appearance="inline">https://example.com</a></p>A plain URL link with inline card appearance. The documentation says a pasted Jira URL becomes the macro, but this probe used a non-Jira address, so it shows only the link form.
Rendered view (HTML)
<p><a class="external-link" data-card-appearance="inline" href="https://example.com" rel="nofollow">https://example.com</a></p>Storage format after the round trip through ADF
<p><a href="https://example.com" data-card-appearance="inline">https://example.com</a></p>Sent to Confluence Cloud on .
What changes in conversion
- All parameters of the three probes survived storage to ADF and back. In ADF they are macroParams entries on an extension node, with extensionKey jira or jirachart.
- The single-issue form is an inlineExtension, so it returns wrapped in a paragraph. The query-table form is a block extension and returns with a data-layout="full-width" attribute added to the macro element.
- The views of the key and table forms are not listed as examples because they contain a user id placeholder. The table view has the column headings key, summary and status and a refresh link, and the single-issue view has the text 'Getting issue details...'.
- Confluence reordered the parameters of the table form when it stored them: jqlQuery was written after maximumIssues and columns.
Pitfalls
- body.view holds placeholders, not issue data. The single-issue view reads 'Getting issue details...' and the table view has headings only, because the issues are loaded by the browser.
- The two macros do not share a parameter name for the query: jira uses jqlQuery and jirachart uses jql in the probes.
- jirachart gave the message 'The chart is not supported.' in the view. The probes did not vary the chart type, so the parameters that select a pie, created-versus-resolved or two-dimensional chart are not covered by the probes.
Questions and answers
Does storage keep the JQL exactly as written?
In the probe, project = WEB came back unchanged in the jqlQuery parameter after the storage, ADF and storage round trip.
Is a pasted Jira URL stored as a macro?
The documentation says Confluence converts a pasted Jira URL to the macro. That paste behaviour was not probed.
Related
- Smart links: inline, card and embed
- Reporting macros (content by label, recently updated, attachments...)
- details and detailssummary (page properties)
- Unknown and empty macros
- html, iframe and widget macros