2017-09-28 41 views
1
from pprint import pprint 
from atlassian import Confluence 

confluence = Confluence(
    url='xxx', 
    username='xxx', 
    password='xxx') 

status = confluence.update_page(
    parent_id=22028117, 
    page_id=38284221, 
    title='', 
    body='<h1 id="WindowsSignatureSet2.4.131.3-2-HandoffinstructionstoOperations">Handoff instructions to Operations</h1>',  
) 

print(status) 

嘗試更新匯合頁面時出現以下錯誤。直到昨天它工作正常。什麼地方出了錯?更新匯合頁面時出錯

Traceback (most recent call last): 
File "con_update.py", line 37, in 
parent_id=22028117 
File "C:\Python36-32\lib\site-packages\atlassian\confluence.py", line 76, in update_page 
'version': {'number': version}}) 
File "C:\Python36-32\lib\site-packages\atlassian_init_.py", line 57, in put 
return self.request('PUT', path=path, data=data, headers=headers).json() 
File "C:\Python36-32\lib\site-packages\atlassian_init_.py", line 42, in request 
response.raise_for_status() 
File "C:\Python36-32\lib\site-packages\requests\models.py", line 851, in raise_for_status 
raise HTTPError(http_error_msg, response=self) 
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error 
+0

不能使用匯合的API更新遞增版本號? – lazydeveloper

回答

0

您還沒有發送遞增的版本number.for更新過程中,你必須通過1

from pprint import pprint 
from atlassian import Confluence 

confluence = Confluence(
    url='xxx', 
    username='xxx', 
    password='xxx') 

status = confluence.update_page(
    parent_id=22028117, 
    page_id=38284221, 
    title='', 
    version=x,//latest version number+1 
    body='<h1 id="WindowsSignatureSet2.4.131.3-2-HandoffinstructionstoOperations">Handoff instructions to Operations</h1>',  
) print(status)