I am trying to copy a page to one space to another INCLUDING the attachments. I works to copy the whole page with this code:
#I want to easily copy a page from one space to another space
page_id = confluence.get_page_id("MARLENETES", "NewMarlene(1)")
print(page_id)
# retrieve the page, including its content.
page_c = confluence.get_page_by_id(page_id, expand='body.storage')
#print(page_c)
# the body HTML
body = page_c['body']['storage']['value']
print(body)
parent_id = confluence.get_page_id("NB", "halli2")
for i in range(1, 2):
print('new test'.format(i))
# use the same above to retrieve the parent page's id.
confluence.create_page('MARLENETES', 'NewMarlene({})'.format(i), body, parent_id, type='page', representation='storage', editor='v2')
time.sleep(1)
But the problem is that any images included in the page are not copied. In stackoverflow I found this answer: https://stackoverflow.com/questions/63061984/how-to-move-confluence-pages-along-with-the-contents-from-one-space-to-another-u
I don't want to accept that it "just doesn't work" with Python. Has anybody solved the problem?