Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,949
Community Members
 
Community Events
168
Community Groups

How to get user worklog per person using Jira Rest Api

Request parameter is email Address. 

3 answers

0 votes

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

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

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