From f53db77661f8276dd732f2985568efa3a5323acc Mon Sep 17 00:00:00 2001 From: hyGeorg Date: Tue, 7 Jan 2025 13:00:30 +0100 Subject: [PATCH] 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. --- atlassian/confluence.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index a93782b52..070001a8a 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -146,6 +146,24 @@ def page_exists(self, space, title, type=None): else: return False + def share_with_others(self,page_id, group, message): + """ + Notify members (currently only groups implemented) about something on that page + """ + url = "rest/share-page/latest/share" + params = { + "contextualPageId": page_id, + #"emails": [], + "entityId": page_id, + "entityType": "page", + "groups": group, + "note": message + #"users":[] + } + r = self.post(url, json=params,headers={"contentType":"application/json; charset=utf-8"},advanced_mode=True) + if r.status_code != 200: + raise Exception("failed sharing content {code}: {reason}".format(code=r.status_code,reason=r.text)) + def get_page_child_by_type(self, page_id, type="page", start=None, limit=None, expand=None): """ Provide content by type (page, blog, comment)