Hi,
I'm using Script Runner to calculate the total estimate, remaining work and total time spent of all issues and subtasks related to an epic.
JQL is working fine
issuefunction in subtasksOf("'Epic Link' = ABC-1") OR "Epic Link" = ABC-1 AND issueFunction in aggregateExpression("Total Estimate for all Issues", "originalEstimate.sum()", "Remaining Estimate for all Issues", "remainingEstimate.sum()", "Total Time spent", "timespent.sum()")
and results in an alert box when executing the search showing all my times.
Problem / Challenge:
I want to create 3 custom fields for all my epics dynamically calculating and showing the times for all issues and subtasks in it.
I'm looking forward to hints & tips! Thanks!
Anja
If you are already using ScriptRunner it would as easy as creating a scripted field with the script inside being something based on JQL search:
https://scriptrunner.adaptavist.com/4.3.6/jira/recipes/misc/running-a-jql-query.html
this will get you the issues.
Once you have the issues it is all about calculating the field you want to display. Something like this:
def resultSum = 0
results.getIssues().each {epicIssue->
resultSum+=epicIssue.getOriginalEstimate()
}
return resultSum
change getOriginalEstimate() with getEstimate() and getTimeSpent() as needed
https://docs.atlassian.com/software/jira/docs/api/7.0.0/com/atlassian/jira/issue/Issue.html
also check out Adaptavist documentation on Scripted Fields:
https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Anastasia Kozlova,
thanks for the hint and I would love to use it, but I'm not smart enough to figure out the Java code for my logic above I'm no developer.
Best, Anja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great question, if you figure it out I'd be interested in knowing as well!
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.