Forums

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

Time spent in Epic vs Tempo

Andrzej Biedrawa January 16, 2019

Good day!

Is it possible to configure JIRA Dashboard - Epic lists to additionally show how much time has been registered for each Epic (and all issues that are included in it)? We do register time using Tempo Timesheets. Apparently it does not provide any field that could show summarized time on Dashboard. I was also considering to use Epic SumUp which correctly shows time when Epic details are shown, however it looks like Epic SumUp fields cannot be used in JIRA Dashboard. Has anyone had similar challenge and what would be suggested solution? 

Regards,

Andrzej

2 answers

1 accepted

0 votes
Answer accepted
Marc Minten (EVS)
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 16, 2019

Hi, I am using the scriptrunner plugin and added a scripted (custom) field to the Epics.

Andrzej Biedrawa January 16, 2019

Am I correct by understanding that with ScriptRunner you have developed some cascading update? I mean any time a new worklog is registered under Epic your macro also increase Total Time field in Epic? Thanks for helping me to sort this out!

Marc Minten (EVS)
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 16, 2019

In fact, a scripted field is a field that is "calculated" at the moment the field is shown on screen (with some good caching :-)). So there is not really a "cascading update".

Andrzej Biedrawa January 16, 2019

Any chance you for sharing the script file or quoting the inline script please? That would be very helpfull...

Marc Minten (EVS)
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 17, 2019

 

The script code is

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager

Issue epicIssue = issue

if (epicIssue.getIssueType().getName() != "Epic") {
return null
}

IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager()

Long timeSpent = 0
if (epicIssue.getTimeSpent()) {
timeSpent = timeSpent + epicIssue.getTimeSpent()
}
epicIssue.getSubTaskObjects().each { subIssue ->
if (subIssue.getTimeSpent()) {
timeSpent = timeSpent + subIssue.getTimeSpent()
}
}
issueLinkManager.getOutwardLinks(epicIssue.getId()).each { epicLink ->
if (epicLink.getIssueLinkType().getName() == "Epic-Story Link") {
Issue epicLinkedIssue = epicLink.getDestinationObject()
if (epicLinkedIssue.getTimeSpent()) {
timeSpent = timeSpent + epicLinkedIssue.getTimeSpent()
epicLinkedIssue.getSubTaskObjects().each { subIssue ->
if (subIssue.getTimeSpent()) {
timeSpent = timeSpent + subIssue.getTimeSpent()
}
}
}
}
}
if (timeSpent == 0) {
timeSpent = null
}
return timeSpent

and the Script Field Template should be set to "Duration (time-tracking)"

Then you see for example in the Epic view :

Capture.PNG

Like Bodavo likes this
Andrzej Biedrawa January 17, 2019

Dear Marc!

What I can say - works like a charm. This is exactly what I needed! 

Thank you very much, I owe you a beer or two!

Marc Minten (EVS)
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

Great. Will you bring me the beer :-):-) ?

Trisha Griffis March 8, 2019

Marc,


Is there a way to do this script and base it on the Estimated Story Points? We do not use the time tracking tool but want the ability to show the story points total for all linked issues for that Epic. Can you suggest something for this situation?

Marc Minten (EVS)
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.
March 11, 2019

Hi Trisha,

 

Yes, of course. Just replace the getTimeSpênt() method by a getCustomFieldValue of the appropriate field ...

Senthil Kumar Thangaraj
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!
August 8, 2019

Thanks for the script. I tried in scripted field and it gave me the time spent only when i have logged on the epic. It doesnt add the sub-task of stories to the epic.

Our hierarchy is epic -- story / task --subtasks . We log hours either in subtask for the story or in tasks for the epic. How can i get all logged time and sum it for Epic?

I need this to add to my big picture for Scaled Agile.

 

Thanks in advance.

Marc Minten (EVS)
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.
August 8, 2019

Hi, this is exactly what the script does: sum-up all time registered on the Epic, on its sub-tasks, on the Stories/Tasks in the Epic and on their respective sub-tasks !

Senthil Kumar Thangaraj
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!
August 9, 2019

yes, it did. It really helps. Thanks a lot.

Mrudula.Madugu October 6, 2022

Hi

The above code doesn't working in scriptrunner cloud,  Can you please share me the script for cloud?

Thanks

Mrudula

Marc Minten (EVS)
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.
October 6, 2022

We are not using Cloud....

Scripts are very different...

Gergely Groupama
Contributor
March 17, 2023

Hi @Marc Minten (EVS) t,

Thanks for the script for this issue!

It works fine for me as well, but there is the issue that it displays the sum of logged times in seconds... :D

While this is very entertaining in a brain teasing way, do you know if there is any way to set up a conversion that changes the way the value is displayed?

Thanks in advance,

Gergely

Gergely Groupama
Contributor
March 20, 2023

Never mind! We managed to solve it in house.

Thanks,

G

Like Dave Rosenlund _Trundl_ likes this
0 votes
Melanie DuPont
Contributor
April 1, 2019

Here's an alternate solution:

Reporting the Time Logged against a Jira Epic

  1. In Jira, Tempo > Reports > Custom Report
  2. Filter By, Epics.
  3. Type in your Epic's key. For example, XYZ-123. When you see the correct epic appear in the list, click it. Then, click in any white area to make the Epics box disappear.
  4. You should see a list of all issues (stories, tasks, etc.) that are part of your chosen Epic, along with a Total of all the time (∑ or Worked Hours) logged to these issues.

Suggest an answer

Log in or Sign up to answer