Forums

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

Worklog Pagination JIRA REST API

Kelly Gomes
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!
October 26, 2022

Hey guys!

 

Context of my project:
I am using the JIRA API and creating code in Python to populate a table in MySql to generate automatic dashboards in Power BI. We are currently using the google sheets addon to bring all the information of all issues, but as the team is growing, we will transfer this information into a database for better processing.

Problem: There are issues with more than 20 worklogs and I need to retrieve all of them, but the API only retrieves 20.

Endpoint I am using: https://xxxxxxxxxx/rest/api/2/search?jql=project IN (xxxxxxx) AND &timespent>0&maxResults=100&page?limit=100&startAt={startAt}&fields=worklog,issuetype,key,parent,summary,assignee,status,project"

Notice that in the middle of the endpoint I added the "{startAt}", and in the code I used the While function to make a pagination which brought me all the issues, and it worked correctly, the table was filled with all the issues.

Question: Is it possible to make a pagination to bring ALL worklogs? If not, is there any workaround to be done? I really need it to bring in all the worklogs as we do a tracking of the hours spent by the developers.

This is a print of the code that brings the worklogs, and as you can see, it brings up only 20 results (20 worklogs IDs). It is in this section that I would like to know if it is possible to do a pagination via jira's rest API.

Capturar.JPG

Thanks in advance!

 

1 answer

0 votes
Hana Kučerová
Community Champion
October 27, 2022

Hi @Kelly Gomes ,

you should be able to get all worklogs for issue using

GET /rest/api/2/issue/{issueIdOrKey}/worklog

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events