Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2179,3 +2179,25 @@ def get_subtree_of_content_ids(self, page_id):
if child_subtree:
output.extend([p for p in child_subtree])
return set(output)

def set_inline_tasks_checkbox(self, page_id, task_id, status):
"""
Set inline task element value
status is CHECKED or UNCHECKED
:return:
"""
url = "/rest/inlinetasks/1/task/{page_id}/{task_id}/".format(page_id=page_id, task_id=task_id)
data = {"status": status, "trigger": "VIEW_PAGE"}
try:
response = self.post(url, json=data)
if response.status_code == 200:
return True
else:
return False
except HTTPError as e:
if e.response.status_code != 200:
raise ApiError(
"Param cannot be empty",
reason=e)
raise

3 changes: 3 additions & 0 deletions docs/confluence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@ Other actions
# Compare content and check is already updated or not
confluence.is_page_content_is_already_updated(page_id, body)

# Add inline task setting checkbox method
confluence.set_inline_tasks_checkbox(page_id, task_id, status)