diff --git a/atlassian/confluence.py b/atlassian/confluence.py index f195ae2fd..12ace9a54 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -506,27 +506,20 @@ def get_page_comments( return response - def get_draft_page_by_id(self, page_id, status="draft"): + def get_draft_page_by_id(self, page_id, status="draft", expand=None): """ - Provide content by id with status = draft - :param page_id: - :param status: + Gets content by id with status = draft + :param page_id: Content ID + :param status: (str) list of content statuses to filter results on. Default value: [draft] + :param expand: OPTIONAL: Default value: history,space,version + We can also specify some extensions such as extensions.inlineProperties + (for getting inline comment-specific properties) or extensions. Resolution + for the resolution status of each comment in the results :return: """ - url = "rest/api/content/{page_id}?status={status}".format(page_id=page_id, status=status) - - try: - response = self.get(url) - except HTTPError as e: - if e.response.status_code == 404: - raise ApiPermissionError( - "The calling user does not have permission to view the content", - reason=e, - ) - - raise - - return response + # Version not passed since draft versions don't match the page and + # operate differently between different collaborative modes + return self.get_page_by_id(page_id=page_id, expand=expand, status=status) def get_all_pages_by_label(self, label, start=0, limit=50): """ diff --git a/atlassian/jira.py b/atlassian/jira.py index a120ee8ac..fc7e9c38b 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -1355,7 +1355,7 @@ def issue_field_value_append(self, issue_id_or_key, field, value, notify_users=T else: new_value = [value] - fields = {'{}'.format(field): new_value} + fields = {"{}".format(field): new_value} return self.put( "{base_url}/{key}".format(base_url=base_url, key=issue_id_or_key),