Not able to extract more than 500 issues using jira python api.

Lavina
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2019

 i am using Jira-python API to extract description and summary from jiras in my project. My project has around 1700 issues. but i am only able to extract a max of 500 issues. I am extracting all issues in a data frame using pandas.  i followed this approach given in this link . But unable to fix it. kindly help.

extracting data from jira

 

from jira import JIRA
jira = JIRA('https://jira.spring.io')
block_size = 1000
block_num = 0
allissues = []
while True:
start_idx = block_num*block_size
issues = jira.search_issues('project=XD', start_idx, block_size)
if len(issues) == 0:
# Retrieve issues until there are no more to come
break
block_num += 1
for issue in issues:
#log.info('%s: %s' % (issue.key, issue.fields.summary))
allissues.append(issue)

 

2 answers

1 accepted

1 vote
Answer accepted
Ian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2019

Hello @xoxo ,

 

What is the value of your server's jira.search.views.default.max (found in System > Advance Settings)? By any chance is it 250? 

I am not that familiar with Jira-python API but I believe it is calling Jira server's Search REST API underneath the hood, hence, jira.search.views.default.max will be used as the limit.

If your jira.search.views.default.max is not 1000, try changing your block_size to your default max value, then I think it should be ok.

 

Cheers,

Ian

0 votes
4 D
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2022

Hi,

it should be possible to use the maxResults parameter in your call "jira.search_issues", for example "maxResults=1000"

 

If you need to get more than 1000 items, just try "maxResults=False" that allows retreiving all possible items without limitation

erin mahagan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 21, 2022

Hi, I tried this and maxResults=False does not pull the full amount of issues.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events