Skip to content

Commit 7e29697

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
Gonchik Tsymzhitov
authored and
Gonchik Tsymzhitov
committed
Confluence: task id method
1 parent d5db9f6 commit 7e29697

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

atlassian/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.13.4
1+
1.13.5

atlassian/confluence.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ def update_or_create(self, parent_id, title, body):
556556
result = self.create_page(space=space, parent_id=parent_id, title=title, body=body)
557557

558558
log.info('You may access your page at: {host}{url}'.format(host=self.url,
559-
url=result['_links']['tinyui']))
559+
url=((result or {})
560+
.get('_links') or {}).get('tinyui')))
560561
return result
561562

562563
def convert_wiki_to_storage(self, wiki):
@@ -875,7 +876,7 @@ def delete_plugin(self, plugin_key):
875876
url = 'rest/plugins/1.0/{}-key'.format(plugin_key)
876877
return self.delete(url)
877878

878-
def check_long_task_result(self, start, limit, expand):
879+
def check_long_tasks_result(self, start, limit, expand):
879880
"""
880881
Get result of long tasks
881882
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
@@ -893,6 +894,18 @@ def check_long_task_result(self, start, limit, expand):
893894
params['limit'] = limit
894895
return self.get('rest/api/longtask', params=params)
895896

897+
def check_long_task_result(self, task_id, expand):
898+
"""
899+
Get result of long tasks
900+
:param task_id: task id
901+
:param expand:
902+
:return:
903+
"""
904+
params = None
905+
if expand:
906+
params = {'expand': expand}
907+
return self.get('rest/api/longtask/{}'.format(task_id), params=params)
908+
896909
def get_pdf_download_url_for_confluence_cloud(self, url):
897910
"""
898911
Confluence cloud does not return the PDF document when the PDF

0 commit comments

Comments
 (0)