Oauth Api returns only 0-50 issues,Is there a way to increase maxresults to 1000

Jaswanth Sanikommu May 27, 2021

Create connection:

access_token = dbutils.secrets.get(scope = "jira", key = "access_token")
access_token_secret = dbutils.secrets.get(scope = "jira", key = "access_token_secret")
consumer_key = dbutils.secrets.get(scope = "jira", key = "consumer_key")
key_cert = dbutils.secrets.get(scope = "jira", key = "key_cert")
oauth_dict = {
'access_token': access_token,
'access_token_secret': access_token_secret,
'consumer_key': consumer_key,
'key_cert': key_cert}
jira = Jira(
url='https://projects.example.com/',
oauth=oauth_dict
)

 

JQL = 'project = IP AND issuetype = Initiative AND status in ("In Progress",  "Warranty Period") ORDER BY cf[16227] ASC, priority DESC, cf[16216] ASC'

data = jira.jql(JQL)

 

Sample output:

{'expand': 'schema,names', 'startAt': 0, 'maxResults': 50, 'total': 315, 'issues_0_expand': 'operations,versionedRepresentations,editmeta,changelog,renderedFields', 'issues_0_id': '246425', 'issues_0_self': 'https://projects.example.com/rest/api/2/issue/246425', 'issues_0_key': 'IP-175', 'issues_1_expand': 'operations,versionedRepresentations,editmeta,changelog,renderedFields', 'issues_1_id': '245700', 'issues_1_self': 'https://projects.example.com/rest/api/2/issue/245700', 'issues_1_key': 'IP-171',................................................

 

 

I am getting a result from 0 to 50 , Is there a way to get results from 50-100,101-150, etc

like "startAt": 50

Or is there a way to do pagination for Oauth? Please suggest.

Or get maxResults

1 answer

1 accepted

0 votes
Answer accepted
Jaswanth Sanikommu May 28, 2021

This issue is solved I referred to the Atlassian python API documentation

https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py

 

Solution:

data = jira.jql(JQL,'*all',50)

Startat=50 (can be iterated like 100,200 etc)

Fields=*all

Suggest an answer

Log in or Sign up to answer