Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a excerpt-include table via the Python API

James Mulholland
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2023

Hi, I have a script that currently creates multiple pages, with the goal of having a 'main' page with excerpt-include tables that link to child pages each of which with a 'excerpt' table on them. I have verified this works by creating it on Confluence manually.

I want to automate this creation, and I've managed to create all of the pages and the excerpt tables on the child pages. I can't work out however how to create the excerpt-include macro and link it properly. I've only managed to create an empty excerpt-include macro with the following:

 

<ac:structured-macro ac:name="excerpt-include"></ac:structured-macro> 
 
Do I need to pass the ID of the excerpt macro I want to link in this? Or how would I set this widget up?

1 answer

0 votes
Ivan LN
Contributor
May 18, 2026

3 years late, but leaving my solution here in case it helps someone. 

I'm creating pages in confluence dynamically and I have a page in the same space and folder with the excerpts that I want to include in the page. 

I have a function to load the excerpt I need: 

def get_excerpt_include_macro(excerpt_name):
return f"""
<ac:macro ac:name="excerpt-include">
<ac:parameter ac:name="nopanel">true</ac:parameter>
<ac:parameter ac:name="name">{excerpt_name}</ac:parameter>
<ac:default-parameter>Static Information</ac:default-parameter>
</ac:macro>
"""
The body of my Confluence page is in HTML, so I remove the head and body tags, add the excerpts before or after and render the page

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events