Hey team, I have this query.
created >= -156w AND (due >= -104w OR due = null) AND project = Dashboard ORDER BY key DESC
When I run it in the browser at {mycompany}.atlassian.net/issues/?jql=created >%3D -156w AND (due >%3D -104w OR due %3D null) AND project %3D Dashboard ORDER BY key DESC I get 1828 issues
When I run it in Python, I only get 928 issues. Python code is below. Why the discrepancy when I copied and pasted the JQL from one to the other?
from jira import JIRA
import re
jiraOptions = {'server': "https://mycompany.atlassian.net"}
jira = JIRA(options = jiraOptions,
basic_auth = ("myemail",
"mytoken"))
issues = []
batch_size = 200
index = 0
while index < 5000:
issue_batch = jira.search_issues('created >= -156w AND (due >= -104w OR due = null) AND project = Dashboard ORDER BY key DESC', startAt=index, maxResults=batch_size)
print(f"Issues {index} through {index + batch_size-1}")
issues.extend(issue_batch)
index += batch_size
with open ("issues.txt", 'w', encoding='utf-8') as file:
for issue in issues:
file.write(f"{issue.key}\n")
It seems you're splitting the result in half because you get more data in maxResult compared to your browser. Your code uses maxResult 200, try using 100 as batchsize and see if you get the same result with the browser.
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.