2

I am using jira-python client and trying to fetch all issues currently open in a project or component.

but while trying this it gives me error :

jira.search_issues('project=ABC and assignee != currentUser()', 
                   startAt=0, 
                   maxResults=0, 
                   json_result=True)

This I am using to get the total number of issues currently associated with project & I get below error :

Warning (from warnings module):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\jira\client.py", line 1744
    warnings.warn('All issues cannot be fetched at once, when json_result parameter is set', Warning)
Warning: All issues cannot be fetched at once, when json_result parameter is set

Any idea can I proceed further to fetch all issues currently open (new status) in a project or component.

vanishka
  • 167
  • 2
  • 12

1 Answers1

0

I am answering my question as I have found the solution to it.

json_result=True

cannot be used while fetching all results in JIRA-Python client, using json_result = False the value that is returned is of type

class 'jira.client.ResultList'

which can be converted to list in order to parse further accordingly. And to proceed with searching of new/Open issues in a project , following JQL can be used (example for Open issues created in last 7 days).

issues=jira.search_issues('project = ABC AND issuetype = DEF AND resolution = Unresolved AND status = "New" AND component = "JKL" AND created >= "-7d"',
                       startAt=0,
                       maxResults=0, json_result=False)
vanishka
  • 167
  • 2
  • 12