Forums

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

Can anyone help me on how we can create a tabs container macro using python?

razak shaik August 13, 2023

I tried to create a macro html and tabs container on the confluence server but after sending a PUT request I am getting an unknown macro for the tabs container, entering into edit mode I could see there is a tabs container, and for html macro the content is not visible. Please find the code below and help me with this.

 

I tried with tabs container, tabs-container, etc, and without third-party parameters.

<ac:structured-macro ac:name="tabs-container" ac:schema-version="1" ac: third-party="true"> <ac:parameter ac: name="title">Mt Tabs conatiner</ac: parameter> <ac:rich-text-body>

<ac:structured-macro ac:name="tabs-page" ac: schema-version="1" ac: third-party="true"> <ac: parameter ac:name="title"> Tab 1 </ac: parameter> <ac:rich-text-body> This is content of TAB 1</ac: rich-text-body> </ac:structured-macro>

<ac:structured-macro ac:name="tabs Page" ac:schema-version="1" ac:third-party="true"> <ac:parameter ac:name="title"> Tab 2 </ac: parameter>

<ac:rich-text-body> This is content of TAB 2</ac:rich-text-body>

</ac:structured-macro>

</ac:rich-text-body>

</ac:structured-macro>

2 answers

0 votes
razak shaik August 14, 2023

We are using confluence server 7.19.6.

 

I am just sending the above content stored in a variable called updated_data using PUT request to confluence server.

 

data = {

"version ":{

 "number" : 3

},

"title": "Testing",

"type": "page",

"body":{

 

"storage": {

       "value": updated_data,

       "representation": "storage"

}

 

response = requests.put(

parent_page_url,

json=data,

headers={"Authorization": f"Bearer {api_token}", "Content-Type": "application/json"},

)

 

print (response.text

razak shaik August 14, 2023

This question is specific to tabs container and tabs page macros. I just informed that html macros are also not working for me. Let me know if more details are required.

0 votes
Sayed Bares [ServiceRocket]
Community Champion
August 14, 2023

@razak shaik welcome to the community!

What is your Confluence version? and what is the script you are using in python? you mentioned HTML macro but your storage format doesn't contain any, can you elaborate further on this?

razak shaik August 19, 2023

@Sayed Bares [ServiceRocket] Any on this please.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events