我正在使用 confluence API(使用 python)来更新现有的 confluence 页面,但我遇到以下错误:
atlassian.errors.ApiValueError: No space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is current
奇怪的是,我之前可以更新页面 10 次,但突然抛出错误。也许我错过了什么?
任何人都可以提出缺少的内容吗?我正在使用下面的代码片段:
confluence = Confluence(url=confluence_url,username=userid,password=password)
status = confluence.update_page(page_id, title, pagecontent)
pprint(status)
最佳答案
我看到同样的错误,因为我的页面内容包含 <DC>
在其中和 HTML 中 <
和>
需要转义。
似乎是 update_page
的第三个参数需要有效的 html 字符串。
您可以使用它escape
python 中的方法(如果您使用的是 python 3.4+)
from html import escape
from atlassian import Confluence
confluence = Confluence(url=confluence_url,username=userid,password=password)
status = confluence.update_page(page_id, title, escape(pagecontent))
pprint(status)
关于python : atlassian. 错误。ApiValueError : No space or no content type, 或设置了错误的版本类型设置为内容,或状态参数不是草稿,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70266387/