The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to sum Remaining and Logged time for JIRA dashboard (groovy, Scipt Fields)?

Vladimír Rahm
October 12, 2014

Hi,

I know, how to sum these (remaining + logged time) for single issue:

remaining = issue.getEstimate()

loggedTime = issue.getTimeSpent()

 

But how to sum it, when I need to include subTasks and structure-subIssues? Any help is welcome.

 

Thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
JamieA
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 Champions.
October 13, 2014

Both of those values are milliseconds, so you can just sum them

Subtasks is just iterating each subtask and adding.

Getting structure sub-issues is more complex, there is an example of how to query structures here: https://jamieechlin.atlassian.net/wiki/display/GRV/Scripting+Other+Plugins#ScriptingOtherPlugins-AllDescendantsMustbeResolvedCondition

But it's the same deal, get the issues and sum the two values.