Skip to content

Commit 65903d8

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
authored andcommitted
Confluence: add other posibility to get draft pages
1 parent 050087c commit 65903d8

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
@@ -194,6 +194,24 @@ def get_all_draft_pages_from_space(self, space, start=0, limit=500, status='draf
194194
status=status)
195195
return (self.get(url) or {}).get('results')
196196

197+
def get_all_draft_pages_from_space_through_cql(self, space, start=0, limit=500, status='draft'):
198+
"""
199+
Search list of draft pages by space key
200+
Use case is cleanup old drafts from Confluence
201+
:param space: Space Key
202+
:param status: Can be changed
203+
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
204+
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
205+
fixed system limits. Default: 500
206+
:return:
207+
"""
208+
url = 'rest/api/content?cql=space=spaceKey={space} and status={status}'.format(space=space,
209+
status=status)
210+
params = {}
211+
params['limit'] = limit
212+
params['start'] = start
213+
return (self.get(url, params=params) or {}).get('results')
214+
197215
def get_all_restictions_for_content(self, content_id):
198216
"""
199217
Returns info about all restrictions by operation.

0 commit comments

Comments
 (0)