Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I query or dashboard the issues that have the most other issues linking to them?>

Doug Clendening June 29, 2021

I want to get a quick feel of how important an issue is. To do this, I need to count how many other tickets link to the potentially important tickets.

One view into the data I want is a simple table with the columns KEY and LINKED_TO_COUNT. Then, I'd be able to sort on LINKED_TO_COUNT to find the most important (linked to) issues on top.

We currently have ScriptRunner if that helps, but not an extra dashboarding addon. I do not see an way to do this with built in dashboard gadgets as the "Group By" fields are randomly limited per gadget. I also have no idea if ScriptRunner can do counting/statistics itself, outside of a dashboard.

2 answers

1 accepted

0 votes
Answer accepted
Doug Clendening June 29, 2021

I solved this in a completely unscalable way, and I'm hoping there's a much easier way I missed:

  1. Create two custom Number fields. One called "Links In" and one called "Links Out"
  2. Apply the fields to any issues you'll want to dashboard or count up
  3. Download the ScriptRunner addon
  4. Create a new Script Listener and choose all of the issueLink events to trigger from
  5. Write a groovy script that grabs both the sourceIssueId and destinationIssueId from the events, looks up their issues from /rest/api/3/issue, and sums up the inwardLinks and outwardLinks they have
  6. Update/Put the new inward and outward link counts into the sourceIssueId and destinationIssueId's issues in the custom "Links In/Out" fields

Finally, at this point the link counts exist in the tickets and you can dashboard it or simply sort by the "Links In/Out" columns in a table.

I highly suggest ignoring Jira searching and dashboarding altogether and using something like Splunk to do the dashboarding. It's much more flexible and takes much less effort once you know the SPL.

0 votes
Doug Clendening June 29, 2021

So far, I've tried creating scripted fields with ScriptRunner to count of links via the cloud API. However... these scripted fields cannot be used by dashboard (or dashboard addons it seems).

I may have to resort to a ScriptedListener from ScriptRunner to update a custom field on Link Create and Link Delete.

Ouch.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events