Skip to content
Merged
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
42 changes: 42 additions & 0 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,33 @@ def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):

return response.get('results')

def get_child_title_list(self, page_id, type='page', start=None, limit=None):
"""
Find a list of Child title
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
:return:
"""
child_page = self.get_page_child_by_type(page_id, type, start, limit)
child_title_list = [child['title'] for child in child_page]
return child_title_list

def get_child_id_list(self, page_id, type='page', start=None, limit=None):
"""
Find a list of Child id
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
:return:
"""
child_page = self.get_page_child_by_type(page_id, type, start, limit)
child_id_list = [child['id'] for child in child_page]
return child_id_list


def get_child_pages(self, page_id):
"""
Get child pages for the provided page_id
Expand Down Expand Up @@ -117,6 +144,21 @@ def get_parent_content_id(self, page_id):
log.error(e)
return parent_content_id

def get_parent_content_title(self, page_id):
"""
Provide parent content title from page id
:type page_id: str
:return:
"""
parent_content_title = None
try:
parent_content_title = (
(self.get_page_by_id(page_id=page_id, expand='ancestors').get('ancestors') or {})[-1].get(
'title') or None)
except Exception as e:
log.error(e)
return parent_content_title

def get_page_space(self, page_id):
"""
Provide space key from content id
Expand Down