How to get user worklog per person using Jira Rest Api

Priyantha De Costa May 7, 2019

Request parameter is email Address. 

3 answers

0 votes
Alexander Szymanski September 11, 2022

I know that this Topic is an old one, but as people, like me still searching for answers, I'd like to do my part. It is not the solution but might gives you a hint, how to start!

Most likely a user how query's an api also knows how to iterrate data and or filter them after getting a result, so :

rest/api/latest/search?jql=worklogDate>=2022-09-05 AND worklogAuthor=currentUser()

(spaces and special charakters will be mask by browser, or need to be converted for any other application, but were replaces for better reading original request would be)

/search?jql=worklogDate%3E=2022-09-05%20AND%20worklogAuthor=currentUser()

would be a good starting point, as it gives you all tickets with worklogs of the current user, where at leased one worklog was updated by that user ... be careful this does also gives you worklogs of other users within the issue and or the issue if the user has given any worklog in the pasted, but an other user has logged time...

but it narrows the data to filter by an own application by far...
i'll let you know if i find an more elegant way!

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2019

Hello Priyantha,

The Worklog returned by the API is per issue rather than per user.  To pull out the users worklog you would need to return all issues worklog data for a specified time period and then filter them by author, The following two posts give some examples of what is needed with links to github repos with example code that can be pulled from and modified for your needs.

There is an example of how to get all worklogs in the following post, noting that this is a very heavy operation as discussed in the comments:

And an example of how to parse the worklog per user in this post:

But a better approach would be to look into a tool dedicated to user time tracking, "Timesheet Reports and Gadgets" and "Tempo Timesheets" are two popular options for this type of reporting, but also check out the following marketplace link for a list of additional time tracking add-ons:

Regards,
Earl

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2019

Hello Priyantha,

The Worklog returned by the API is per issue rather than per user.  To pull out the users worklog you would need to return all issues worklog data for a specified time period and then filter them by author, The following two posts give some examples of what is needed with links to github repos with example code that can be pulled from and modified for your needs.

There is an example of how to get all worklogs in the following post, noting that this is a very heavy operation as discussed in the comments:

And an example of how to parse the worklog per user in this post:

But a better approach would be to look into a tool dedicated to user time tracking, "Timesheet Reports and Gadgets" and "Tempo Timesheets" are two popular options for this type of reporting, but also check out the following marketplace link for a list of additional time tracking add-ons:

Regards,
Earl

Suggest an answer

Log in or Sign up to answer