How to get worklog time spent by user in a project on a specified date range via JQL

Shiva Gaire January 20, 2019

Hi all,

I would like to get a work log time spent by a user over a specific date range

For example. If a user logs work in a project ABC in date 2019/1/18, but he logs work for the date of 2019/1/2. How can I get how much the users have spent time on the project in the date range 2019/1/1 to 2019/1/7?

Thank you in advance for your help.

4 answers

1 vote
Rambabu Patina _Appfire_
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.
January 20, 2019

Hi @Shiva Gaire, Welcome to the community.

Have you tried the below JQL:

project = <project_key>   and worklogAuthor = <author> and worklogDate >= "2019/01/01" and worklogDate <= "2019/01/07"

And let us know.

Thanks,
Ram.

Shiva Gaire January 23, 2019

Hi, Thank you for your response.

I did the same however I want to get the time spent via aggregateExpression or something like that, not just the total time spent from the beginning.

project = ST  and worklogDate >= "2019/01/10" and worklogDate <= "2019/01/12"  AND issueFunction in  aggregateExpression("Total Estimate for all Issues", "originalEstimate.sum()", "Remaining work", "remainingEstimate.sum()", "Total Time Spent", "timeSpent.sum()")


I got the following output. 

Remaining work:0 minutes

Total Estimate for all Issues:0 minutes

Total Time Spent:2 days, 3 hours

But, what I want is the time spent only for the duration I mentioned but not the total time spent aggregated from the very begining. I have script runner and tempo as plugins

Time Spent: 6 hours

Remaining Work: <n> hours

 

IS there any way to get like this. Your help will be highly appreciated.

0 votes
Piotr Bojko
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.
January 21, 2019

With Smart QL you can do following queries:

SELECT * 
FROM WORKLOGS W
JOIN AUX.JQL('ID','PROJECT = ABC') JQL ON W.ISSUE = JQL.ID
WHERE W.STARTDATE BETWEEN ? AND ?
AND AUTHOR = ?

you can further modify such query to have summaries, per day, etc or even place the data on a dashboard chart .

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2019

@Piotr Bojko Thanks for contributing an additional possible solution here.  However in the future, please review our Atlassian Community guidelines for Marketplace vendors and Solution Partners.  Specifically, we would prefer that you identify yourself as being affiliated with the plugin/app in question before recommending it.  Thanks.

Like # people like this
Piotr Bojko
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.
January 24, 2019

Ouch sorry for that. For sure I am affiliated with the mentioned app. I will make my best to be more political correct.

 

Again, sorry for that.

0 votes
Ramaiah Pendli January 20, 2019

Hi Shiva,

Use the Tempo Timesheets add-on track the user/team time logs for a specific time frame. 

Shiva Gaire January 23, 2019

Hi, Thank you for your response.

I am able to get the desired output in the UI for the specific JQL filter I have using the tempo timesheets. But I am looking for the API or JQl alternative that can be run with scriptrunner.

I am unable to find any help from this API docs.

Your help on this will be highly appreciated

Suggest an answer

Log in or Sign up to answer