Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Return more than 5000 worklogs for a given issue

kleb12 December 13, 2022

using the following python code I get a returned value of 5000 worklogs for any issue that I input:

jira = JIRA(options, basic_auth=(user,apikey))
jira.worklogs(issue='ABC-123')

 

This wasn't the case about a month ago. Is there any workaround for this or a change I can make to my python code to only get the most recent worklogs for a specific issue via jql or something?

1 answer

0 votes
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2022

Hello @kleb12 

You seem to be using some third party Python module which is providing that jira.worklogs() function. Have you checked with the publisher of that module?

The v3 REST API of Jira Cloud has always returned 5,000 worklogs per issue per request by default and you need to use the startAt parameter to move to next page of worklog records (read the docs), so it's not clear how you were able to get more results than that before.

What happens when you make a raw query to the REST API endpoint with a test tool like Postman etc?

Agustin Rovero January 26, 2024

Hi

I´ve been using the jira module that I believe is the official one and the worklogs function doesn't have a maxResults parameter.

This is my code (with credentials and issue name removed):

from jira import JIRA
import jira

jira_options = {'server':server}
credentials = (email,token)

client = JIRA(options = jira_options,basic_auth = credentials)

issue = client.issue('myissue')
print(a.fields.worklog.total) # This line prints 9574 in my case.

# Can't use maxResults, I get:
# TypeError: worklogs() got an unexpected keyword argument 'maxResults'
work = self.client.worklogs(issue = issue) # Without maxResults it works.
print(len(work)) # This line prints 5000.

Thank you

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events