ScriptRunner JQL - Dashboard display all children and childrens children of an issue type

Roberto L
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2017

Hello Community,

I am trying to build a dashboard in Jira that displays all the children, and the children of its children for one specific issue type.

In my Jira instance I have a hierarchy of issue types that go as follows:

  • Feature 
    • Epic
      • Story
        • Subtasks

As you can see, Feature is on the top of the chain.

  • A Feature will only have Epic's as its children
  • An Epic will have a Feature as its parent and Stories as its children
  • A Story will have Epic as its Parent and Sub tasks as its children.

I want to make a filter, to display on a dashboard, that grabs everything underneath a Feature (this means all the Epics underneath it, all the Stories underneath it, all the subtasks underneath it). 

I have not been able to do this yet and was hoping someone could provide me with some information as to how this can be achieved.

Additionally, I want to make it so I can filter on the filter mentioned above.

I would like to enter a specific Feature ID and filter the results of the above filter such that it only shows the children underneath that specific Feature.

Thank you for your time!

-Roberto

 

2 answers

0 votes
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2021

It seems like you have Advanced roadmaps, so you can use:

key in portfolioChildIssuesOf("FEATURE-1")

0 votes
Justin Evans
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2017

Hi Roberto- I know you mentioned Script Runner specifically, but wanted to show an example of how this could be done with Power Scripts.

You'd save the following script in SIL Manager with filename InitiativeIssues.sil:

/* This script will return all Epics, Standard Issue Types, and Sub-task
Issue Types associated with a supplied Jira Portfolio Initiative.

Example JQL: key in silJQLList(InitiativeIssues.sil, INITIATIVE-24)
*/

string [] results;

string [] initiatives = selectIssues("\"Parent Link\" = " + argv[0]);
for(string epic in initiatives) {
  results += %epic%.key;
  string [] standards = selectIssues("\"Epic Link\" = " + %epic%.key);
  for(string standard in standards) {
    results += %standard%.key;
    string [] subtasks = selectIssues("parent = " + %standard%.key);
    for(string subtask in subtasks) {
      results += %subtask%.key;
    }
  }
}

return results; 

 Then in JQL search, you'd run

key in silJQLList(InitiativeIssues.sil, FEATURE-1)

This would return all Epics, Standard Issue Types and Sub-task Issue Types associated with the variable Feature ID for use in filters, dashboard gadgets, etc.

Suggest an answer

Log in or Sign up to answer