Skip to content

Commit f53db77

Browse files
authored
Confluence: added possibility to share news based on a confluence page (#1470)
* added possibility to share news based on a confluence page * removed f-strings, types and trailing spaces.
1 parent f0a88f2 commit f53db77

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
@@ -146,6 +146,24 @@ def page_exists(self, space, title, type=None):
146146
else:
147147
return False
148148

149+
def share_with_others(self,page_id, group, message):
150+
"""
151+
Notify members (currently only groups implemented) about something on that page
152+
"""
153+
url = "rest/share-page/latest/share"
154+
params = {
155+
"contextualPageId": page_id,
156+
#"emails": [],
157+
"entityId": page_id,
158+
"entityType": "page",
159+
"groups": group,
160+
"note": message
161+
#"users":[]
162+
}
163+
r = self.post(url, json=params,headers={"contentType":"application/json; charset=utf-8"},advanced_mode=True)
164+
if r.status_code != 200:
165+
raise Exception("failed sharing content {code}: {reason}".format(code=r.status_code,reason=r.text))
166+
149167
def get_page_child_by_type(self, page_id, type="page", start=None, limit=None, expand=None):
150168
"""
151169
Provide content by type (page, blog, comment)

0 commit comments

Comments
 (0)