Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

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

Sum field values from all issues in epic if another field equals a specific value (JMCF)

Krzysztof Kiser
Contributor
January 12, 2021

Hi, 

 

I’ve been trying to create a custom field that sums all field values for all issues in an epic if a value of another field is equal to a specific value. 

 

I’ve been able to accomplish the sum, however I can’t get the condition to work. 

 

My exact case: 

sum all “Days Off” for all issues in an epic if “Day Off Type” = “Annual Leave"; “Holiday on Demand". 

 

What I got so far: 

issue.stories.sum {it.get("Days Off")}

 

I am not sure where to add the if and how to go through all of the stories of the epic.

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2021

Hi @Krzysztof Kiser ,

try this:

issue.stories.findAll {it.getAsString("Day Off Type") in ["Annual Leave", "Holiday on Demand"]}.sum {it.get("Days Off")}
Krzysztof Kiser
Contributor
January 12, 2021

@David Fischer This worked like a charm. Thank you very much for your help!

Suggest an answer

Log in or Sign up to answer