Skip to content

Commit 22e70f3

Browse files
Added get_workflows_paginated method. (#596)
1 parent 7702923 commit 22e70f3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

atlassian/jira.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,30 @@ def get_all_workflows(self):
20422042
url = 'rest/api/2/workflow'
20432043
return self.get(url)
20442044

2045+
def get_workflows_paginated(self, startAt=None, maxResults=None, workflowName=None, expand=None):
2046+
"""
2047+
Provide all workflows paginated (see https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflow-search-get)
2048+
:param startAt: OPTIONAL The index of the first item to return in a page of results (page offset).
2049+
:param maxResults: OPTIONAL The maximum number of items to return per page.
2050+
:param workflowName: OPTIONAL The name of a workflow to return.
2051+
:param: expand: OPTIONAL Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: (transitions, transitions.rules, statuses, statuses.properties)
2052+
:return:
2053+
"""
2054+
url = 'rest/api/2/workflow/search'
2055+
2056+
params = {}
2057+
if startAt:
2058+
params['startAt'] = startAt
2059+
if maxResults:
2060+
params['maxResults'] = maxResults
2061+
if workflowName:
2062+
params['workflowName'] = workflowName
2063+
if expand:
2064+
params['expand'] = expand
2065+
2066+
return self.get(url, params=params)
2067+
2068+
20452069
def get_all_statuses(self):
20462070
"""
20472071
Returns a list of all statuses

0 commit comments

Comments
 (0)