Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get jira project issues total count faster using jira-python?

The following code returning all jira's and taking more time. i want to get the total jira count faster, without jira details

jira.search_issues('project=PROJ and assignee != currentUser()')

From the following link we can get total count using JQL, How to do the same using jira-python. https://jira.atlassian.com/browse/JRA-29903

Tried following code by adding maxResults=0, but it is returning empty list instead of total jira count.

jira.search_issues('project=PROJ and assignee != currentUser()', 
                   startAt = 0, 
                   maxResults = 0)
like image 870
Lava Sangeetham Avatar asked Mar 09 '23 11:03

Lava Sangeetham


1 Answers

Add the argument json_result=True

from jira import JIRA

jira = JIRA('https://jira.atlassian.com')
jira.search_issues('project=CLOUD and assignee != currentUser()', 
                   startAt=0, 
                   maxResults=0, 
                   json_result=True)

Output:

{'issues': [], 'maxResults': 0, 'startAt': 0, 'total': 2704}

You can see additional options with Python's built-in help:

help(jira.search_issues)
like image 70
brennan Avatar answered Apr 05 '23 22:04

brennan