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
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.