Estimating Release Tasks Reported Times with Jira REST APIs
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.