Skip to Main Content

Estimating Release Tasks Reported Times with Jira REST APIs

Jira REST API

Jira REST APIs are used to interact with the Jira server for several purposes. Basically, they provide access and interaction with features like issues and workflows. In this blog, we are interested in sharing how to query epics, stories, and access logged work time to provide a way to estimate the time for release tasks using the Jira REST APIs.


Using Python Wrapper for the Jira API

The Jira REST APIs can be accessed in several ways. For example, they can be invoked using a POST request with the appropriate parameters. There are wrappers for specific languages such as R (used in statistical analysis) and Python. For the purposes of this article, the examples and other details, we will use Python. When using Python, a script should start like this:


Release Tasks in SDK

For analysis of release tasks in the SDK group, the Jira stories, bug fixes, incidents addressed, and in general any components or features addressed by a given release are handled primarily through a release epic that should be in place for the release tasks. This is a common best practice to keep things well organized. 

A specific query written in Jira Query Language (JQL) is required to use release epics stories and sub-tasks, incorporated in a Python script. The syntax looks like this (notice that the variable ‘epickey’ contains the epic number for the specific release of interest). Notice that the query selects only stories or bugs with status DONE or RESOLVED:


Querying Jira with the Python Wrapper to Retrieve Reported Times

Once we get the stories that are with status Done or Resolved for a given release epic, it is then possible to get the reported times with the following lines of Python code. Note that the code prints the report in easy to read values for convenience:

 

Using the Jira API is a convenient method to retrieve information that would be otherwise complicated to do with pure Jira queries. A language such as Python allows for data formatting and other operations that permit efficient and clear data analysis to keep track of projects.

Miguel Restrepo, Software Development Manager of SDKs

Miguel Restrepo joined Accusoft in 2018 as a software development manager in SDK. His teams provide development and support to BarcodeXpress, FormSuite, and PICTools. Miguel received his master’s and PhD degrees from the University of Illinois at Urbana-Champaign. Miguel has a passion for good communication and a positive, constructive approach to management and leadership. He enjoys software development, open source software, scientific computation, and other interesting projects and technologies like Raspberry Pi. When he’s not working, Miguel enjoys spending time with his wife and sons, gardening, cooking, and other fun activities.