Hi dear community,
I'd need your help to find an alternative solution to a scripted custom field (Epic Time Spent) that was implemented with the 3rd-party app ScriptRunner; we won't have this application available in our new Cloud environment.
This is the Groovy script that is currently used to calculate and display the total logged time of an Epic and all the issues within it (in hours): ⬇️
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
Are you aware of any native solutions we could use, instead?
Or maybe a new customisation using Automation for Jira / JMWE?
Appreciate any help! 🙏
Posting what I came up with to solve our use case (using only native functionalities + Automation for Jira), it might be useful for someone with a similar use case 🤞
The variable is not strictly needed to achieve this, but I'll have to expand the automation so I've left it there.
Hi
Thanks for the above rule, but this rule is not working when timelogged for subtask in the stories, Epic timelog is not updating. Do you have any suggestion here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've noticed you are looking for a solution that doesn't need any expenses. Maybe you will be interested in out app Teamlead: EpicTime for Jira - SumUp of Worklogs.
It's free for teams that are up to ten users.
EpicTime sums up work logs of child issues to the epic. Also, you can view the following information within Epic's issues:
A variety of reports provides data about time results for all epic issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Giulia Caberlotto ,
You can try Reports - Charts and Graphs for Jira app developed by our team to create various reports, charts and graphs for your Jira projects.
Here is a sample report that shows sum of time spent by epic.
Below you can see an article about creating custom reports, charts and graphs in Jira with our app.
How to Create Custom and Flexible Reports, Charts and Graphs in Jira
Here is our live demo dashboard where you can see and modify sample reports and play with them.
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! Thanks for the suggestion.
We’re aware that this could be calculated via 3rd party apps like yours, however, this is not budgeted at the moment and we're looking for a different solution, as we'd also need to display the Epic Time Spent field within the epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.