Forums

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

Why does /worklog return an empty array when using Jira API?

Rushi M
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!
April 4, 2021

Hello,

I am using the JIRA api to access worklog data for my project. I am calling this url for a specific issue.

https://api.atlassian.com/ex/jira/389e43e1-f9e2-46c0-ac66-8fa41ecef199/rest/api/2/issue/10001/worklog

When I call the api, there is no error and I get a 200 message which is good. However when I check the response this is what it is:

{'startAt': 0, 'maxResults': 1048576, 'total': 0, 'worklogs': []}

Worklogs is empty for some reason. This call is made for my own project that I made in which I sent time tracking to some random value like 2 hours (check picture below). So I should be having something returned. Maybe its a permissions issue?

Let me know.atlassian.PNG

1 answer

0 votes
Kurt Klinner
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.
April 4, 2021

@Rushi M 

Hi Rhushi

 

welcome to the Atlassian community.

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/

states that you should use 

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

to get the worklog entries for a specific issue, although /rest/api/2 also seems to work

Just did run a small example  successfully via curl on my instance

curl -D- -X GET -H 'Accept: application/json' --user USERNAME:APITOKEN https://MYDOMAIN.atlassian.net/rest/api/3/issue/DEMO-1/worklog

so i would suggest to use YOURDOMAIN.atlassian.net/rest/api/3 as starting point

Let me know if that helps

 

Cheers

Kurt

Suggest an answer

Log in or Sign up to answer