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: 

Original Estimates vs. Actual

Fabio Lanza
March 28, 2013

Is there a way in JIRA (at the project level), create a view, report, graph…anything that will show me “Original Estimates vs. Actual” story points delivered?

Our Jira version is 4.4.5.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Onkar Ahire
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.
March 28, 2013

This code will help you to develop reports,graphs of Orignal estimates.

private String getOriginalEstimateString(Issue issue)
{
     long estimate = -1;
     if (issue != null)
     {
            if (issue.getEstimate() != null && issue.getOriginalEstimate() != null)
            {
                estimate = Math.min(issue.getOriginalEstimate().longValue(), issue.getEstimate().longValue());
            }
            if (estimate != -1)
            {
                return DateUtils.getDurationString(estimate, getHoursPerDay(), getDaysPerWeek());
            }
        }
        return null;

    }
private int getHoursPerDay()
{
     return Integer.parseInt(ComponentAccessor.getApplicationProperties().getDefaultBackedString(APKeys.JIRA_TIMETRACKING_HOURS_PER_DAY));
}
private int getDaysPerWeek()
{
       return Integer.parseInt(ComponentAccessor.getApplicationProperties().getDefaultBackedString(APKeys.JIRA_TIMETRACKING_DAYS_PER_WEEK));
}

steven.schafer
July 11, 2013
This is a great code. Where do I put this snippet of code at? I'm fairly new to JIRA and unsure where to put this code snippet. Thanks. Steven
Onkar Ahire
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.
July 11, 2013

Hi Steven,

It depends which plugin module are you implementing, I use this code in report generation.

map.put("orignalEstimates",getOriginalEstimateString(issue));

rendered in *.vm

FYI another useful method I used for report generation to calculateTime and diffs, might helpful

public static long compareTwoTimeStamps(java.sql.Timestamp currentTime, java.sql.Timestamp oldTime)

	{

	     long milliseconds1 = oldTime.getTime();

	     long milliseconds2 = currentTime.getTime();

	     long diff = milliseconds2 - milliseconds1;

		 long diffSeconds = diff / 1000;

		 return diffSeconds;

	 }

	public static String calculateTime(long seconds) 

	 {		

		 int day = (int) TimeUnit.SECONDS.toDays(seconds);

		    long hours = TimeUnit.SECONDS.toHours(seconds) -TimeUnit.DAYS.toHours(day);

		    long minutes = TimeUnit.SECONDS.toMinutes(seconds) -TimeUnit.HOURS.toMinutes(TimeUnit.SECONDS.toHours(seconds));

		    long second = TimeUnit.SECONDS.toSeconds(seconds) -TimeUnit.MINUTES.toSeconds(TimeUnit.SECONDS.toMinutes(seconds));

		    if(day==0 && hours==0 && minutes==0)

			       return second+" sec";

		    if(day==0 && hours==0)

			       return + minutes + " min "+second+" sec";

		    if(day==0)

			       return hours+" hrs "+minutes+" min "+second+" sec";

		    return day+" day "+hours + " hrs " + minutes + " min "+second+" sec";

	 }