Skip to content

Commit c409e92

Browse files
author
Gonchik Tsymzhitov
committed
2 parents 5f6e346 + 7221fa3 commit c409e92

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

atlassian/confluence.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,3 +2211,25 @@ def get_subtree_of_content_ids(self, page_id):
22112211
if child_subtree:
22122212
output.extend([p for p in child_subtree])
22132213
return set(output)
2214+
2215+
def set_inline_tasks_checkbox(self, page_id, task_id, status):
2216+
"""
2217+
Set inline task element value
2218+
status is CHECKED or UNCHECKED
2219+
:return:
2220+
"""
2221+
url = "/rest/inlinetasks/1/task/{page_id}/{task_id}/".format(page_id=page_id, task_id=task_id)
2222+
data = {"status": status, "trigger": "VIEW_PAGE"}
2223+
try:
2224+
response = self.post(url, json=data)
2225+
if response.status_code == 200:
2226+
return True
2227+
else:
2228+
return False
2229+
except HTTPError as e:
2230+
if e.response.status_code != 200:
2231+
raise ApiError(
2232+
"Param cannot be empty",
2233+
reason=e)
2234+
raise
2235+

docs/confluence.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,6 @@ Other actions
222222
# Compare content and check is already updated or not
223223
confluence.is_page_content_is_already_updated(page_id, body)
224224
225+
# Add inline task setting checkbox method
226+
confluence.set_inline_tasks_checkbox(page_id, task_id, status)
227+

0 commit comments

Comments
 (0)