How to add nested macros in confluence page with rest api ?

Tatjana Stojcheska
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!
January 8, 2025

Hello,

I'm developing python script which creates  more pages in confluence cloud. 
I want to add on the pages two nested macros (macro status and macro note) 
I have tried like this 


makros.jpg

and this is how i define the body of the rest api call. 

data = { 'title': subject, 'spaceId': space_key, 'body': { 'storage': { 'value': full_body, 'representation': 'storage' } }, 'metadata': { 'labels': confluence_labels } }

When i try to run the script i get error 

500 {"errors":[{"status":500,"code":"INTERNAL_SERVER_ERROR","title":"Internal Server Error","detail":null}]}

Can someone give me idea how to solve this? Just to mention If i try to add the macros one by one ( not nested) the script works ok . 

Thank you in advance

1 answer

1 vote
Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2025

Hi @Tatjana Stojcheska 

Is this for cloud? Confluence Cloud doesn't support nested macros.

Which macros are you adding manually?

There is an update on this and now you can use some:

https://jira.atlassian.com/browse/CONFCLOUD-78513

But to better understand, which macros are you adding manually?

If that works, go to advanced details -> storage format.

Use the storage format code on your code.

Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events