Reputation: 435
For a customer I need to create monthly reports that shows, among other things, how much time an issue is spending in the different statuses (TO DO, In progress, Closed etc.). More specifically, the customer wants to see, how long it takes from the time when they create the issue, and to the time when we "take" the case and start working on it.
I was quite surprised to find out that you can not get this in Jiras default reporting tools. I have searched for relevant Add-Ons, but most reporting tools is very pricy, and I'm not even sure whether they offer this functionality or not. Isn't this a normal metric to want from a report?
However I found David Bevins Jira Rest Client Dot Net api. Unfortunately this api doesn't give me the opportunity to extract the relevant data (timestamps, activity etc.)
So now I have turned to Jiras rest api, and I am trying to set up a program in .NET to do it. This guy did exactly the same. As you see in his SO question, the returned JSON is a mess. Collecting all the right data will require a lot of work. So before I go further I want to know if anyone has done this before and how you did it?
Any help is appreciated.
Upvotes: 1
Views: 2296
Reputation: 96
There is the Status Time Jira app. It provides reports on how much time passed in each status.
Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days. It has various other reports like assignee time, status entry dates, average/sum reports by any field(eg. average in progress time by project, average cycle time by issue creation month). And all these are available as gadgets on the dashboard too.
Here is the online demo link, you can see it in action and try.
As a free solution, you can try the limited version Status Time Free.
Upvotes: 0
Reputation: 1
"Get issue rest api" provides historical data once you provide expand=changelog query parameter. It returns json response, see sample reponse. Then you need to parse the response, extract the data and make your calculation.
Or you can try Marketplace apps which do the parsing and calculation for you. You can try Status Time app which was developed for this exact need.
Upvotes: 0
Reputation: 1077
There is a library I have created some time ago to pull metrics from Jira: https://bitbucket.org/kaszaq/howfastyouaregoing
From what I understand you are looking for a cycle time of issue in given statuses. I think this example should help you:
package pl.kaszaq.howfastyouaregoing.examples;
import com.google.common.collect.Sets;
import java.time.LocalDate;
import java.time.Month;
import java.util.HashSet;
import java.util.OptionalDouble;
import java.util.SortedMap;
import pl.kaszaq.howfastyouaregoing.agile.AgileClient;
import pl.kaszaq.howfastyouaregoing.agile.AgileProject;
import static pl.kaszaq.howfastyouaregoing.agile.IssuePredicates.hasSubtasks;
import pl.kaszaq.howfastyouaregoing.cycletime.CycleTimeComputer;
public class CycleTimeExample {
public static void main(String[] args) {
AgileClient agileClient = AgileClientProvider.createClient();
runExample(agileClient);
}
private static void runExample(AgileClient agileClient) {
LocalDate from = LocalDate.of(2011, Month.JULY, 1);
int daysAverage = 30;
LocalDate to = LocalDate.of(2014, Month.JANUARY, 1);
AgileProject agileProject = agileClient.getAgileProject("MYPROJECTID");
String[] cycleTimeStatuses = {"In Progress", "Ready for Testing"};
final HashSet<String> finalStatuses = Sets.newHashSet("Closed");
SortedMap<LocalDate, Double> cycleTime = CycleTimeComputer.calulcateCycleTime(agileProject, hasSubtasks().negate(), finalStatuses, cycleTimeStatuses);
System.out.println(
"\tCycle time for issues that do not have sub tasks in hours");
for (LocalDate k = from; !k.isAfter(to); k = k.plusDays(daysAverage)) {
OptionalDouble valueOptional = cycleTime.subMap(k.minusDays(daysAverage), k.plusDays(1)).values().stream()
.mapToDouble(val -> val)
.average();
if (valueOptional.isPresent()) {
System.out.println(k + "\t" + valueOptional.getAsDouble());
}
}
}
}
Upvotes: 0
Reputation: 665
Jira has not this option by default and there is not simple way to solve it programatically.
However it is possible to get this data (but you have to use probably 3 or 4 tables from database):
1) create jira add-on and parse data there
2) use Home Directory Browser (https://marketplace.atlassian.com/plugins/info.renjithv.jira.plugins.sysadmin.homedirectorybrowser/server/overview) for getting data and then parse it in you own program
On Atlassian Marketplace is a plugin exactly for this functionality and it works very well, there are filters, time range and some export options:
https://marketplace.atlassian.com/plugins/com.obss.plugin.time-in-status/server/overview
you can tried the trial version for free.
Upvotes: 1