Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,554,917
Community Members
 
Community Events
184
Community Groups

Structure Formula - Filter Worklogs by Date Range

Edited
James Roy
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!
Apr 13, 2023

Hi there,

First time posting. Not a dev. Extreme newb to expression formula.

I have a structure with issues and subtasks that have work logs against them.

image.png

I would like to sum the work logged between a certain date range using the Jira Structure formula column.

This unexpectedly returns values but the .filter operator is wrong "< sprintStart":

image.png

/* Displays work logged 
between a specified date range.
*/

WITH sprintStart =
       date("27/03/2023") :

WITH sprintEnd =
       date("11/04/2023") :

WITH workLogged =
       worklogs
            .FILTER( $.startDate < sprintStart )
            .FILTER( $.startDate < sprintEnd )
            .timeSpent.SUM() :

       jira_days(workLogged)

 

This however, with the correct operator returns nothing "> sprintStart":


WITH workLogged =
       worklogs
             .FILTER( $.startDate > sprintStart )
             .FILTER( $.startDate < sprintEnd )
             .timeSpent.SUM() :

       jira_days(workLogged)

 

Any help would be great even a whole new direction would be welcome. I know there is a Work Logged column available but I have to use the formula column in this instance.

Cheers,
James

1 answer

1 vote
David Niro _Tempo_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 24, 2023

Hello @James Roy ,

Welcome to the Community!

Apologies for the delay.

I believe it's the Date format that is causing a problem here.  It looks like you are using dd/mm/yyyy.  Try mm/dd/yyyy, it worked for me in my testing.

Please let me know if it helps!

Best,
David

James Roy
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!
May 02, 2023

Hi @David Niro _Tempo_ ,

Thanks for getting back to me. I ended up using the .Filter a little differently. Perhaps trying to use two was causing an issue but the following seemed to work for me.



WITH endDate =
DATETIME("9/May/2023 12:00 AM", "en_AU", "Australia/Melbourne")+86400000 : /*end date plus 1 day*/

WITH startDate =
endDate - (86400000 * 13) : /*end date minus 13 days*/

WITH workLogged =
worklogs
.FILTER( $.startDate > startDate AND $.startDate < endDate )
.timeSpent.SUM() :

CEILING(jira_days(workLogged),3)
Like Dave Rosenlund _Tempo_ likes this

Suggest an answer

Log in or Sign up to answer