Search code examples
jirajqljira-agile

Programming JIRA to show # of bugs and calculate time spent


I would like to program a filter in JIRA to show the number of bugs for a sprint and also calculate time spent. I have tried a number of the current reports but they do not automate this calculation. Has anyone successfully done this? I would prefer to do this via JQL rather than using the API.


Solution

  • With the standard JIRA functionality, the "issue search" page does not offer you a way to summarise values (yet).

    There are a number of add-ons that can help you accomplish this though, for example:

    sumUp

    There is the sumUp add-on which does exactly that and is probably the easiest option.

    Script Runner

    You could also use Script Runner and its aggregateExpression JQL function, which supports "time spent" and other time fields and can give you a view like this: enter image description here Script Runner also has a ton of other useful features to customise JIRA.

    Pivot Gadget

    And if you're looking for a gadget to add on a dashboard instead, you could also use the Pivot Gadget add-on. This one supports pivot tables and can sum up totals, so you get something like this: enter image description here

    No Add-Ons Possible: Use the JIRA REST API

    If installing add-ons is not an option, then you can still script a solution using JIRA's REST API. Especially the search resources will be useful.

    You can use any kind of programming or scripting language to build this. There's already another answer that explains how to do this with bash, but if you google you will also find JIRA REST client libraries for java, python, ...

    Also, most programming languages have very good REST support, so use whatever you are familiar with.