Skip to content

Commit 34f0025

Browse files
authored
Add get_parent_content_title func (#545)
1 parent 6458085 commit 34f0025

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

atlassian/confluence.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ def get_parent_content_id(self, page_id):
117117
log.error(e)
118118
return parent_content_id
119119

120+
def get_parent_content_title(self, page_id):
121+
"""
122+
Provide parent content title from page id
123+
:type page_id: str
124+
:return:
125+
"""
126+
parent_content_title = None
127+
try:
128+
parent_content_title = (
129+
(self.get_page_by_id(page_id=page_id, expand='ancestors').get('ancestors') or {})[-1].get(
130+
'title') or None)
131+
except Exception as e:
132+
log.error(e)
133+
return parent_content_title
134+
120135
def get_page_space(self, page_id):
121136
"""
122137
Provide space key from content id

0 commit comments

Comments
 (0)