Skip to content

Commit 11d26c6

Browse files
authored
added possibility to share news based on a confluence page
1 parent e0307b5 commit 11d26c6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

atlassian/confluence.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ def page_exists(self, space, title, type=None):
136136
else:
137137
return False
138138

139+
def share_with_others(self,page_id:str, group:list, message:str):
140+
"""
141+
Notify members (currently only groups implemented) about something on that page
142+
"""
143+
url = "rest/share-page/latest/share"
144+
params = {
145+
"contextualPageId": page_id,
146+
#"emails": [],
147+
"entityId": page_id,
148+
"entityType": "page",
149+
"groups": group,
150+
"note": message
151+
#"users":[]
152+
}
153+
r = self.post(url, json=params,headers={"contentType":"application/json; charset=utf-8"},advanced_mode=True,)
154+
if r.status_code != 200:
155+
raise Exception(f"failed sharing content {r.status_code}: {r.text}")
156+
139157
def get_page_child_by_type(self, page_id, type="page", start=None, limit=None, expand=None):
140158
"""
141159
Provide content by type (page, blog, comment)

0 commit comments

Comments
 (0)