如何使用 Python 将 Confluence 页面连同内容从一个 space 移动到另一个?

How to move Confluence pages along with the contents from one space to another using Python?

我正在尝试编写一个基于 atlassian-python-api 模块的 Python 脚本,它将从一个 [=24] 复制 spaces =] 并使用以下命令在不同服务器托管的另一个 space 中创建它们:

pages = sourceConfluence.get_all_pages_from_space(space = source_Space, start=0, limit=100, status=None, expand='body.storage.content', content_type='page')
for i in pages:
    status = destConfluence.create_page(space = dest_Space, title=i['title'], body=i['body'], parent_id=None, type='page', representation='storage')

在包含 pdf 或图像等内容的页面出现之前,它工作正常。在这种情况下,它会为新生成的页面中的内容创建一个无效的 link。

如何直接使用包装器或 Confluence REST API 移动内容完整的页面?

据我了解,目前还没有合适的方法以编程方式执行此操作 Python。

我们实现这一目标的唯一方法如下:

  1. 从编辑模式手动复制粘贴页面。
  2. XML 通过将 XML 文件放入 JIRA 服务器来导出和导入 space。
  3. 使用支持此功能的 Bobswift CLI 工具。