Skip to main content
Book your demo
Example scripts
To homepage
New
Confluence
Cloud icon
Cloud

Create a Confluence Template

Created 24 day(s) ago, Updated 20 day(s) ago
App in script
ScriptRunner For Confluence
ScriptRunner For Confluence
by Adaptavist
Compatibility
compatibility bullet
Confluence
Language |
groovy
import groovy.json.JsonOutput

final TEMPLATE_ADF = [
    "type": "doc",
    "content": [
        [
            "type": "panel",
            "attrs": [
                "panelType": "info",
                "localId": "f84e2953-6180-49ec-8f82-86f85fdc3373"
            ],
            "content": [
                [
                    "type": "paragraph",
                    "attrs": [
                        "localId": "0c43bb38e060"
                    ],
                    "content": [
                        [
                            "text": "The numbers are accurate at the time of generation, but the linked Jira JQL query results might have changed as the work items could be updated after the time of generation.",
                            "type": "text"
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "bodiedExtension",
            "attrs": [
                "layout": "default",
                "extensionType": "com.atlassian.confluence.macro.core",
                "extensionKey": "details",
                "parameters": [
                    "macroParams": [
                        "id": [
                            "value": "public-properties"
                        ]
                    ],
                    "macroMetadata": [
                        "macroId": [
                            "value": "b608a329bc13ec395f886268febbd927743f87b49258921c0cdd02416f17937b"
                        ],
                        "schemaVersion": [
                            "value": "1"
                        ],
                        "title": "Page Properties"
                    ]
                ],
                "localId": "269355ee-5edb-4427-9937-cd40de1a9056"
            ],
            "marks": [
                [
                    "type": "fragment",
                    "attrs": [
                        "name": "Extension 1",
                        "localId": "1f3ca739-da2d-47fe-ae93-4d9534010ea4"
                    ]
                ]
            ],
            "content": [
                [
                    "type": "table",
                    "attrs": [
                        "layout": "default",
                        "width": 760,
                        "localId": "5ce1f7b0-48bb-443f-aa81-393e72480f4a"
                    ],
                    "marks": [
                        [
                            "type": "fragment",
                            "attrs": [
                                "name": "Table 3",
                                "localId": "ee45b178-a8a2-4c4f-9f61-bfd4d6fc8f7b"
                            ]
                        ]
                    ],
                    "content": [
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Month (MM/yy)",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#ffffff",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m0",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Onboarded Employees",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e0",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Stakeholders",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "mention",
                                                    "attrs": [
                                                        "id": "YOUR_ATLASSIAN_ACCOUNT_ID",
                                                        "text": "@stakeholder-name",
                                                        "localId": "YOUR_MENTION_LOCAL_ID"
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "bodiedExtension",
            "attrs": [
                "layout": "default",
                "extensionType": "com.atlassian.confluence.macro.core",
                "extensionKey": "details",
                "parameters": [
                    "macroParams": [
                        "hidden": [
                            "value": "true"
                        ],
                        "id": [
                            "value": "hidden-variables"
                        ]
                    ],
                    "macroMetadata": [
                        "macroId": [
                            "value": "978d3c512b59160aa99b806cb1df4bcf9ae56fbeebf3a05b0a8d5c4c08282fde"
                        ],
                        "schemaVersion": [
                            "value": "1"
                        ],
                        "title": "Page Properties"
                    ]
                ],
                "localId": "64230cd1-bafa-4061-8e2a-2c60457c9030"
            ],
            "content": [
                [
                    "type": "table",
                    "attrs": [
                        "layout": "default",
                        "width": 760,
                        "localId": "9a0816a8-5a88-4299-b673-1e7047f2d59a"
                    ],
                    "content": [
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Created employees",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#ffffff",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "created",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Signed employees",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "signed",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "New HR",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "new_hr",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "New Developers",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "new_developers",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "New Sales",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "new_sales",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "New Interns",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "new_interns",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "background": "#f4f5f7",
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Past Monthly Data (",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-1",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-2",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-3",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-4",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-5",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ")",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-1",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-2",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-3",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-4",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "text": ", ",
                                                    "type": "text"
                                                ],
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-5",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "heading",
            "attrs": [
                "level": 1
            ],
            "content": [
                [
                    "text": "Monthly Data",
                    "type": "text"
                ]
            ]
        ],
        [
            "type": "layoutSection",
            "marks": [
                [
                    "type": "breakout",
                    "attrs": [
                        "mode": "wide",
                        "width": 760
                    ]
                ]
            ],
            "content": [
                [
                    "type": "layoutColumn",
                    "attrs": [
                        "width": 50
                    ],
                    "content": [
                        [
                            "type": "extension",
                            "attrs": [
                                "layout": "default",
                                "extensionType": "com.atlassian.chart",
                                "extensionKey": "chart:default",
                                "parameters": [
                                    "dataConsumerFallback": [
                                        "d92385a1-cdb9-47a2-b882-bfd7b2c0346f"
                                    ],
                                    "chartType": "PIE",
                                    "chartGroup": [
                                        "customizeTab": [
                                            "styleField": [
                                                "orientation": "vertical",
                                                "showPoints": false,
                                                "colorPie0": "var(--ds-background-accent-red-subtle, #F87168)",
                                                "colorPie1": "var(--ds-background-accent-green-subtle, #4BCE97)",
                                                "height": "150",
                                                "smooth": false
                                            ],
                                            "titlesField": [
                                                "chartTitle": "Created vs Onboarded",
                                                "yLabel": "Untitled axis",
                                                "xLabel": ""
                                            ],
                                            "legendField": [
                                                "showLegend": true,
                                                "legendPosition": "auto"
                                            ]
                                        ],
                                        "dataTab": [
                                            "yAxisIdxField": [
                                                "1"
                                            ],
                                            "aggregateData": false,
                                            "xAxisIdxField": "0"
                                        ]
                                    ],
                                    "extensionTitle": "Chart"
                                ],
                                "localId": "789e94dc-91e6-4811-a10d-10340d90132c"
                            ],
                            "marks": [
                                [
                                    "type": "dataConsumer",
                                    "attrs": [
                                        "sources": [
                                            "d92385a1-cdb9-47a2-b882-bfd7b2c0346f"
                                        ]
                                    ]
                                ],
                                [
                                    "type": "fragment",
                                    "attrs": [
                                        "name": "Chart 1",
                                        "localId": "6a783b4f-78ee-45ff-be5d-386b09dfd33f"
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "expand",
                            "attrs": [
                                "title": "Created vs Onboarded data"
                            ],
                            "content": [
                                [
                                    "type": "table",
                                    "attrs": [
                                        "layout": "default",
                                        "width": 760,
                                        "localId": "6d4835ba-ec9b-444a-aee9-2cf43da1206a"
                                    ],
                                    "marks": [
                                        [
                                            "type": "fragment",
                                            "attrs": [
                                                "name": "Table 2",
                                                "localId": "d92385a1-cdb9-47a2-b882-bfd7b2c0346f"
                                            ]
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableHeader",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Status",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableHeader",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Number of Onboarding",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ],
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Created",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "type": "inlineExtension",
                                                                    "attrs": [
                                                                        "extensionType": "com.atlassian.confluence.template",
                                                                        "extensionKey": "variable",
                                                                        "parameters": [
                                                                            "name": "created",
                                                                            "type": "text"
                                                                        ]
                                                                    ]
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ],
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Onboarded",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "type": "inlineExtension",
                                                                    "attrs": [
                                                                        "extensionType": "com.atlassian.confluence.template",
                                                                        "extensionKey": "variable",
                                                                        "parameters": [
                                                                            "name": "e0",
                                                                            "type": "text"
                                                                        ]
                                                                    ]
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    "type": "layoutColumn",
                    "attrs": [
                        "width": 50
                    ],
                    "content": [
                        [
                            "type": "extension",
                            "attrs": [
                                "layout": "default",
                                "extensionType": "com.atlassian.chart",
                                "extensionKey": "chart:default",
                                "parameters": [
                                    "dataConsumerFallback": [
                                        "5ed22cb2-27da-4fbb-a351-fbf1f254049e"
                                    ],
                                    "chartType": "PIE",
                                    "chartGroup": [
                                        "customizeTab": [
                                            "styleField": [
                                                "orientation": "vertical",
                                                "showPoints": false,
                                                "colorPie0": "var(--ds-background-accent-blue-subtle, #579DFF)",
                                                "colorPie1": "var(--ds-background-accent-orange-subtle, #FEA362)",
                                                "height": "150",
                                                "smooth": false
                                            ],
                                            "titlesField": [
                                                "chartTitle": "Offered Signed vs Onboarded",
                                                "yLabel": "Untitled axis",
                                                "xLabel": ""
                                            ],
                                            "legendField": [
                                                "showLegend": true,
                                                "legendPosition": "auto"
                                            ]
                                        ],
                                        "dataTab": [
                                            "yAxisIdxField": [
                                                "1"
                                            ],
                                            "aggregateData": false,
                                            "xAxisIdxField": "0"
                                        ]
                                    ],
                                    "extensionTitle": "Chart"
                                ],
                                "localId": "0e1c33e6-3805-462e-adef-099c3174679a"
                            ],
                            "marks": [
                                [
                                    "type": "dataConsumer",
                                    "attrs": [
                                        "sources": [
                                            "5ed22cb2-27da-4fbb-a351-fbf1f254049e"
                                        ]
                                    ]
                                ],
                                [
                                    "type": "fragment",
                                    "attrs": [
                                        "name": "Chart 2",
                                        "localId": "dc914918-53d4-4ef6-a6b6-977ca3e942e5"
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "expand",
                            "attrs": [
                                "title": "Offer Signed vs Onboarded data"
                            ],
                            "content": [
                                [
                                    "type": "table",
                                    "attrs": [
                                        "layout": "default",
                                        "width": 760,
                                        "localId": "cd092380-8dfb-4152-aa1d-c4175413d5e2"
                                    ],
                                    "marks": [
                                        [
                                            "type": "fragment",
                                            "attrs": [
                                                "name": "Table 4",
                                                "localId": "5ed22cb2-27da-4fbb-a351-fbf1f254049e"
                                            ]
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableHeader",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Status",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableHeader",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Number of Onboarding",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ],
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Signed",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "type": "inlineExtension",
                                                                    "attrs": [
                                                                        "extensionType": "com.atlassian.confluence.template",
                                                                        "extensionKey": "variable",
                                                                        "parameters": [
                                                                            "name": "signed",
                                                                            "type": "text"
                                                                        ]
                                                                    ]
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ],
                                        [
                                            "type": "tableRow",
                                            "content": [
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            103
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "text": "Onboarded",
                                                                    "type": "text"
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ],
                                                [
                                                    "type": "tableCell",
                                                    "attrs": [
                                                        "colspan": 1,
                                                        "rowspan": 1,
                                                        "colwidth": [
                                                            199
                                                        ]
                                                    ],
                                                    "content": [
                                                        [
                                                            "type": "paragraph",
                                                            "content": [
                                                                [
                                                                    "type": "inlineExtension",
                                                                    "attrs": [
                                                                        "extensionType": "com.atlassian.confluence.template",
                                                                        "extensionKey": "variable",
                                                                        "parameters": [
                                                                            "name": "e0",
                                                                            "type": "text"
                                                                        ]
                                                                    ]
                                                                ]
                                                            ]
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "heading",
            "attrs": [
                "level": 2
            ],
            "content": [
                [
                    "text": "Onboarding by Roles",
                    "type": "text"
                ]
            ]
        ],
        [
            "type": "table",
            "attrs": [
                "layout": "default",
                "width": 760,
                "localId": "d8265afa-4af1-4cad-89e6-382aa91f841d"
            ],
            "marks": [
                [
                    "type": "fragment",
                    "attrs": [
                        "name": "Table 5",
                        "localId": "78f50a1b-6cf5-48a3-ab47-05c3393a868a"
                    ]
                ]
            ],
            "content": [
                [
                    "type": "tableRow",
                    "content": [
                        [
                            "type": "tableHeader",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "Role",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableHeader",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "Number of Onboarding",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    "type": "tableRow",
                    "content": [
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "HR",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "type": "inlineExtension",
                                            "attrs": [
                                                "extensionType": "com.atlassian.confluence.template",
                                                "extensionKey": "variable",
                                                "parameters": [
                                                    "name": "new_hr",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    "type": "tableRow",
                    "content": [
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "Developer",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "type": "inlineExtension",
                                            "attrs": [
                                                "extensionType": "com.atlassian.confluence.template",
                                                "extensionKey": "variable",
                                                "parameters": [
                                                    "name": "new_developers",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    "type": "tableRow",
                    "content": [
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "Sales",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "type": "inlineExtension",
                                            "attrs": [
                                                "extensionType": "com.atlassian.confluence.template",
                                                "extensionKey": "variable",
                                                "parameters": [
                                                    "name": "new_sales",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    "type": "tableRow",
                    "content": [
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "text": "Intern",
                                            "type": "text"
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableCell",
                            "attrs": [
                                "colspan": 1,
                                "rowspan": 1
                            ],
                            "content": [
                                [
                                    "type": "paragraph",
                                    "content": [
                                        [
                                            "type": "inlineExtension",
                                            "attrs": [
                                                "extensionType": "com.atlassian.confluence.template",
                                                "extensionKey": "variable",
                                                "parameters": [
                                                    "name": "new_interns",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "heading",
            "attrs": [
                "level": 1
            ],
            "content": [
                [
                    "text": "Monthly Trends",
                    "type": "text"
                ]
            ]
        ],
        [
            "type": "paragraph"
        ],
        [
            "type": "extension",
            "attrs": [
                "layout": "default",
                "extensionType": "com.atlassian.chart",
                "extensionKey": "chart:default",
                "parameters": [
                    "dataConsumerFallback": [
                        "4a33cf26-b277-4256-a862-56800371c3e0"
                    ],
                    "chartType": "BAR",
                    "chartGroup": [
                        "customizeTab": [
                            "styleField": [
                                "orientation": "vertical",
                                "showPoints": false,
                                "colorLinear1": "var(--ds-background-accent-orange-subtle, #FEA362)",
                                "height": "350",
                                "smooth": false
                            ],
                            "titlesField": [
                                "chartTitle": "Monthly Onboarded",
                                "yLabel": "Number of Onboarded",
                                "xLabel": "Month"
                            ],
                            "legendField": [
                                "showLegend": false,
                                "legendPosition": "auto"
                            ]
                        ],
                        "dataTab": [
                            "yAxisIdxField": [
                                "1"
                            ],
                            "aggregateData": false,
                            "xAxisIdxField": "0"
                        ]
                    ],
                    "extensionTitle": "Chart"
                ],
                "localId": "60559a04-ab61-4c57-b087-df9a7c56a661"
            ],
            "marks": [
                [
                    "type": "dataConsumer",
                    "attrs": [
                        "sources": [
                            "4a33cf26-b277-4256-a862-56800371c3e0"
                        ]
                    ]
                ],
                [
                    "type": "fragment",
                    "attrs": [
                        "name": "Chart 3",
                        "localId": "3f6a10fa-5069-4f20-a480-73013daee45b"
                    ]
                ]
            ]
        ],
        [
            "type": "expand",
            "attrs": [
                "title": "Monthly Onboarding data"
            ],
            "content": [
                [
                    "type": "table",
                    "attrs": [
                        "layout": "default",
                        "width": 760,
                        "localId": "93b93443-5fb5-461d-858f-95afccac04fd"
                    ],
                    "marks": [
                        [
                            "type": "fragment",
                            "attrs": [
                                "name": "Table 6",
                                "localId": "4a33cf26-b277-4256-a862-56800371c3e0"
                            ]
                        ]
                    ],
                    "content": [
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Month",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableHeader",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "text": "Number of Onboarded",
                                                    "type": "text"
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-5",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-5",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-4",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-4",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-3",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-3",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-2",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-2",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m-1",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e-1",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        [
                            "type": "tableRow",
                            "content": [
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            249
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "m0",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ],
                                [
                                    "type": "tableCell",
                                    "attrs": [
                                        "colspan": 1,
                                        "rowspan": 1,
                                        "colwidth": [
                                            481
                                        ]
                                    ],
                                    "content": [
                                        [
                                            "type": "paragraph",
                                            "content": [
                                                [
                                                    "type": "inlineExtension",
                                                    "attrs": [
                                                        "extensionType": "com.atlassian.confluence.template",
                                                        "extensionKey": "variable",
                                                        "parameters": [
                                                            "name": "e0",
                                                            "type": "text"
                                                        ]
                                                    ]
                                                ]
                                            ]
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ],
        [
            "type": "paragraph"
        ]
    ],
    "version": 1
]

def templateName = 'Employee Onboarding Report'
def templateDescription = 'Monthly employee onboarding report template with metrics, charts, and role breakdown'
def templateAdfJson = JsonOutput.toJson(TEMPLATE_ADF)


// Conf API v1: https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-template/#api-wiki-rest-api-template-post
assert !templateAdfJson.contains('YOUR_ATLASSIAN_ACCOUNT_ID') : 'Replace YOUR_ATLASSIAN_ACCOUNT_ID before running this script.'
assert !templateAdfJson.contains('YOUR_MENTION_LOCAL_ID') : 'Replace YOUR_MENTION_LOCAL_ID before running this script.'
def createTemplateResponse = post("/wiki/rest/api/template")
    .header('Content-Type', 'application/json')
    .body([
        name: templateName,
        templateType: 'page',
        body: [
            atlas_doc_format: [
                value: templateAdfJson,  // use pre-serialized JSON
                representation: 'atlas_doc_format'
            ]
        ],
        // space: [key: 'YOUR_SPACE_KEY'], // Specify a space key to create a space-level template; omit for a global template
        description: templateDescription
    ])
    .asObject(Map)

assert createTemplateResponse.status >= 200 && createTemplateResponse.status < 300 : "${createTemplateResponse.status}: ${createTemplateResponse.body}"

createTemplateResponse.body
Having an issue with this script?
Report it here