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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.