Forums

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

Sum elements from two lists

Caio.Queiroz September 1, 2023

Is there a way to use smart values to sum two list elements and return the sum?

My case is:

I'm trying to get the sum of time spent on issues that are returned by a lookup issue function!

I've tried the following:

It returns the time spent formated, but i'm not able to use .sum to get the sum
{{lookupIssues.timetracking.timespent}} -> 1d 4h 22m, 3d 3m

And it returns two lists that i can't sum their items and then sum the lists

{{lookupIssues.worklog.timeSpent}} -> [41m, 4m, 26m, 19m, 1h, 21m, 29m, 1h 2m, 16m, 1h, 1h, 1h, 1h, 1h 10m, 48m, 4m, 36m, 1h 6m], [51m, 1h, 1h, 1h, 1h, 1h, 20m, 11m, 6m, 33m, 30m, 1h, 1h, 1h, 1h, 1h, 1h, 1h, 30m, 52m]

I've tried to use {{lookupIssues.worklog.timeSpentSeconds.sum}}, but it returns null


1 answer

0 votes
Wojciech Wardaszko
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.
September 1, 2023

Hi @Caio.Queiroz 

It's because the format DD:HH:mm is not a number when it comes to math smart values, and timeSpentSeconds is stored in the timetracking field.

You need to use the {{lookupIssues.timetracking.timeSpentSeconds.sum}} smart value.

Cheers!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events