How can I calculate total estimated time of linked issues?

Mykhaylo Kukharuk July 22, 2012

We have Epic issues as new features, we're going to develop. These Epics goes thru its own workflow as requirements is being prepared. Once we prepare user-stories and technical tasks, they all are linked to specific Epic.

When we negotiate the proposed feature(Epic) with clients we need to understand its estimated time which actually is total estimated time of all linked issues.

Question: Is that possible to get total estimated time of all linked issues somehow?

Thank you!

5 answers

1 accepted

3 votes
Answer accepted
Igor Sereda [ALM Works]
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.
July 23, 2012

Mykhaylo, one way to do that is with our Structure plugin, see if it works for you:

  1. Install "Structure" from Plugins menu, follow "Configure" link, switch to "License Details" tab (Administration | Structure | License Details), click on the link to get a free evaluation license and install it.
  2. Enable the project in question for Structure on that "Configuration" tab in the same admin menu.
  3. Exit Administration and open Issues tab (the search). On the search page, run a search (JQL or whatever) that would show all Epics you're interested in.
  4. Then on the search results page, click Views | Structure - this will open an empty structure with a side list of issues showing you the results of search. Click "Add All" to add them to the structure.
  5. Click "+" icon that appears when you hover your mouse over the grid header and add "Total Remaining Estimate" - this column will show you the total estimations you're looking for.
  6. Now it's time to automatically add stories and technical tasks to the structure. Open Structure | Manage Structure page, and click Import.
  7. Select "Issue Links" as the source of import. On the next page, select link type and direction. All other parameters should be fine in their default values. Run import.
  8. Click "Structure" to go back to structure. It should display a hierarchy of Epics and issues linked to them. (However, a child issue can be linked to only one parent!)

If that's what you need, you can also configure a synchronizer to keep this structure up-to-date as you update issues and create/remove links, and also install other synchronizers like sub-tasks synchronizer or GreenHopper synchronizer.

Hope this helps!
Igor

Disclosure: I work for the company behind Structure plugin.

Mykhaylo Kukharuk October 9, 2012

Thank you, Igor, but it is too expensive solution for our case.

2 votes
Bhushan Nagaraj
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 10, 2012

You can write a custom field that displays the total value of the estimate time for the linked issues. See screenshots attached.

I have also attached the .java file that does this for you.

Currently what I have implemented only displays the long value. You can figure out how you can format that to display the value in hours minutes and second.

If there are linked issues

------------------------------------------------------------------------------------------------------------------------------------

If there are no linked issues

--------------------------------------------------------------------------------------------------------------------------------------

If issue linking is diabled


--------------------------------------------------------------------------------------------------------------

Java code

public class EstimatedTotal extends TextCFType {
    private static final Logger log = LoggerFactory.getLogger(EstimatedTotal.class);

    public EstimatedTotal(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager) {
        super(customFieldValuePersister, genericConfigManager);
    }

    @Override
    public Map<String, Object> getVelocityParameters(final Issue issue,
                                                     final CustomField field,
                                                     final FieldLayoutItem fieldLayoutItem) {
        final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);

        IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager();
        // This method is also called to get the default value, in
        // which case issue is null so we can't use it to add currencyLocale
        if (issue == null) {
            return map;
        }

        String status = "Issue linking is disabled. Total Estimated time required: ";
        Long totalEstimate = new Long(0);
        if(issueLinkManager.isLinkingEnabled()){
            List<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(issue.getId());
            if(inwardLinks ==null || inwardLinks.size() ==0){status="No linked issues. Total Estimated time required: ";}
            else{status=inwardLinks.size() +" linked issues found. Total Estimated time required: ";}
            for(IssueLink link:inwardLinks){
                Issue linkedIssue = link.getSourceObject();
                totalEstimate = totalEstimate.longValue() + linkedIssue.getEstimate();
            }
        }

        status = status + totalEstimate.toString();
        field.createValue(issue,status);
        field.store();

        FieldConfig fieldConfig = field.getRelevantConfig(issue);
        //add what you need to the map here

        return map;
    }
}

Mykhaylo Kukharuk October 10, 2012

Thank you very much! I'll check it with our JIRA support team.

Allen Powell May 28, 2015

Can you confirm how you were able to get the JAVA code into a custom field? I have the groovy plugin but not sure that will work without being converted to Groovy. Are you using a specific plugin to call this JAVA code? Please confirm!

Greg Ranz May 28, 2015

Can you confirm how you were able to get the JAVA code into a custom field? I have the groovy plugin but not sure that will work without being converted to Groovy. Are you using a specific plugin to call this JAVA code? Please confirm!

Greg Ranz May 28, 2015

@Bhushan Nagaraj Can you confirm how you were able to get the JAVA code into a custom field? I have the groovy plugin but not sure that will work without being converted to Groovy. Are you using a specific plugin to call this JAVA code? Please confirm!

1 vote
Yousaf July 27, 2017

And now it´s July 2017.. still waiting for this function.. 

0 votes
John Gilmore July 28, 2016

And now it's July 2016...

0 votes
Deleted user July 3, 2015

July 2015 and I still cannot believe that JIRA does not automatically estimate the time of a story based on subtasks and linked issues.

 

Why is not possible to do it out of the box?

Suggest an answer

Log in or Sign up to answer