Leveraging Adaptivist Scriptrunner to create a dashboard for dependencies in Jira

Date
September 8, 2022
Tag
JiraSoftware Development

Introduction

In this post I'll show you how we can use them to create a dashboard view in Jira which displays all the relevant information about our dependencies and their status.

Using dependencies to plan development work in Jira

There are a few ways that you can use dependencies in Jira to plan your development work.

First, let's look at how you might use them for sprint planning:

You have a list of issues that need to be done before another team can start working on their own ticket. You could go through each one manually and put it into the correct order in Jira, but that's not ideal! Instead, let Dependencies do all the heavy lifting for you.

The built-in roadmap view in Jira allows you to visualize dependencies between all of your issues so that they're easier to understand at a glance-however-the ability to contextualize issues with the status of their dependencies and linked issues is almost nonexistent elsewhere in Jira, and there's no built in Jira feature that gives you the option to view all blocked issues or all blocking issues. I set out to build a dashboard that would give my team and I greater context about how to do this.

What is a Jira Dashboard?

A Jira Dashboard is a collection of views, filters and charts that can be used to display the status of projects. The purpose of a Jira dashboard is to give you a quick overview of the status of your projects. You can also use them to perform time-saving actions or view key metrics.

Jira dashboards are made up of views, filters and charts. Views are what you see on the screen. They contain information about your project(s), such as issues and their status, tasks and their progress, etc. Filters allow you to narrow down the amount of data that’s displayed in a view by applying conditions (such as issue status). Charts display numerical data using graphical representations like bar charts or pie charts.

What is JQL?

Jira has a query language, called JQL (Jira Query Language), that you can use to search and filter your data. You can save these queries as filters so that they are available for use in your dashboards.

For example, if you have a workflow in Jira and want to see all of the issues which are in the “reopened” state and have not been assigned to anyone yet, then you could run this query:

`issuetype="Bug" AND status = "Open" AND assignee = null`

This would return all open bugs that haven't been assigned yet.

The Problem

At this time, there's no straightforward JQL query for "is blocked" or "blocks other issues" in the issue tracker. This means that you have to manually go through each issue and see if it's blocked by other issues. This can be time consuming, especially in large projects with many issues.

The Solution

I've been a Jira user for several years now, but it's only recently that I've started to use its scripting capabilities.

While less powerful than some other tools, Adaptivist Scriptrunner enables you to build complex queries that can be saved and used to create dashboards and agile boards.

image

What is Adaptivist Script Runner?

Adaptivist Script Runner is an add-on that allows Jira administrators to enhance and automate JIRA workflows, JQL functions, custom fields, listeners and more. It's the perfect tool for automating repetitive tasks so you can focus on more important things.

JQL functions extend Jira's built-in capabilities, allowing you to conduct more granular searches and obtain more detailed information about what is happening in your instance and projects.

The LinkedIssuesOf function returns issues that are linked to the results of the subquery. I wanted to create a list of all issues in my project that were still blocked by open issues (and therefore not yet ready to work on. This means my subquery needed to be

  • "project = TT AND issuetype in (Bug, Task) AND status in (Discovery, "In Progress", "Needs Grooming", New, Ready)"
  • In English, this means find me all issues in the project TT that are either in Discovery, in progress, needs grooming, new, or ready.

Remember: you can find the JQL query for any search criteria by doing an advanced search in Jira and then changing the input type to JQL

and my link name needed to be: "blocks"

This returned the following complete function:

  • issueFunction in linkedIssuesOf("project = TT AND issuetype in (Bug, Task) AND status in (Discovery, "In Progress", "Needs Grooming", New, Ready)", "blocks")
  • In English, this means: Find me all issues in the project TT that are either in Discovery, in progress, needs grooming, new, or ready, and then show me a list of issues that are blocked by those issues

By saving this function as a filter and syncing this filter to a dashboard, I was able to create a dashboard that continuously shows me the results of this function.

Here are some of the other functions I created:

Open Issues that block Other Open Issues:

issueFunction in linkedIssuesOf("project = "TT" AND status IN ("Discovery","Needs Grooming","New","Ready")", "is blocked by") AND status IN ("Discovery","Needs Grooming","New","Ready","In Progress","Under Review")

Phase 1 issues that are now unblocked:

issueFunction in linkedIssuesOf("project = TT AND status in (Approved, Closed, Deployed)", "blocks") AND status in (Discovery, "Needs Grooming", New, Ready) AND fixVersion = "Phase 1"

You can read more about Adaptivist Scriptrunner's Issue Links functions here:

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/issue-links

Conclusion

Adaptivist Script Runner is a powerful tool that can help you create a Jira dashboard that shows dependencies between issues, so you can plan your development work more effectively and reevaluate active sprints and focus your team's attention on the issues that are blocking progress elsewhere. You can use Adaptivist Script Runner to automatically create and update a Jira board with the status of your team's blocked issues, which makes it easier for everyone involved to see what's going on at any given time.

image