The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I am using confluence rest api and python module requests to create multiple pages in confluence.
I will have parent and child hierarchy of pages. I want to insert children display macro at parent page using rest api call.
code sample:
invpagebodyhtml = "<p><b>This page is published by automation tool.</b></p>"
create_page = json.dumps( { "type": "page", "title": "testing-notification", "space": {"key": "TEST"}, "ancestors": [{"id": 1234567}], "status": "current", "body": {"storage": {"value": invpagebodyhtml, "representation": "storage",}}, })
response = requests.request( "POST", URL, data=create_page, headers=headers,)
any help on how to include that macro here?
Thanks
Sukh
I got it worked with adding this to my html
old html:
invpagebodyhtml = '<p><b>This page is published by automation tool.</b></p>'
new html:
invpagebodyhtml = '<p><b>This page is published by automation tool.</b></p><p><ac:structured-macro ac:name=\"children\" ac:schema-version=\"1\" /></p>'
Great, many thanks for the answer. Eventually, you don't know how to add the 'Depth' parameter into this syntax ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had to trial and error this, but I just figured out how to do this, this is an example for the 'all'/descendants property:
<p><ac:structured-macro ac:name=\"children\" ac:schema-version=\"1\"><ac:parameter ac:name=\"all\">true</ac:parameter></ac:structured-macro></p>
It took me forever to find the docs: https://confluence.atlassian.com/conf59/children-display-macro-792499081.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.