Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ython-api into master
  • Loading branch information
Gonchik Tsymzhitov committed Sep 1, 2020
2 parents 5f6e346 + 7221fa3 commit c409e92
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions atlassian/confluence.py
Expand Up @@ -2211,3 +2211,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
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)

0 comments on commit c409e92

Please sign in to comment.