Parent Link Queries In Portfolio

If anyone has some guidance on how to get dynamic Portfolio Queries I would appreciate it. Here is what I have:

• Issue “A” (a custom issue type) is at the top of my JIRA Portfolio hierarchy
• Issue “B” (custom issue type) has a Parent Link to issue “A” (it is second in my Portfolio hierarchy)
• Issue “C” (an Epic) has a Parent Link to Issue “B”
• Issue “C” has Stories, and those Stories have Sub-tasks.

I’m looking for a query that will return a list that includes:

  • A specific “A” issue and all parent links to “A” (the “B”’s). "A" is my issue of interest
  • “B” and all parent links to “B” (the Epics)
  • All Epics (the “C”’s), the Stories in each of those Epics and the Sub-tasks under each story.

I'd like this query to be the Portfolio Plan that I deal with, and further to be able to change my issue of interest dynamically (without having to change Porfolio data sources).

With great help from Johnny at Adaptivist and a minor addition, I’ve gotten the query results I'm looking for, but I'm struggling with how to setup a Portfolio Plan that allows me to change the issue of interest based on what I want to look at, without having to reconfigure issue sources in Portfolio all the time.

The query I ended up with involved creating a custom script field and then creating some filters around it. If you're interested here's how the query results problem was solved (thanks in large part to Johhny), here you go:

Grandparent Link custom script:

<import com.atlassian.jira.component.ComponentAccessor

if (issue.issueType.name == "Epic") {
def parentLink = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Parent Link")
def value = issue.getCustomFieldValue(parentLink)
def parentKey = value.key
def parent = ComponentAccessor.issueManager.getIssueByCurrentKey(parentKey)
def grandParent = parent.getCustomFieldValue(parentLink)
return grandParent.key
}
return null>

... and then running these filters;

filter 1: issue = [issue = PPM-38 OR "Parent Link" = PPM-38 OR "Grandparent Link" = PPM-38]

filter2: filter = 1 OR issueFunction in linkedIssuesOfAllRecursive('filter = 1')

Mark--

 

 

2 answers

1 accepted

This widget could not be displayed.

Hi @Mark O'Connor,

 

If I understand correctly, your issue might be solved by the Scriptrunner `PortfolioChildrenOf` function detailed here: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_portfolio

 

Hopefully that will be enough to match your requirements or help you move forward, let us know how it went!

 

Cheers,

Thomas

Thanks @Thomas Barthelemy. Yes indeed. I was actually working with the folks at ScriptRunner on this back in June. They incorporated this into a subsequent release, which we downloaded, and it works great.

This item is closed from my persepctive. Thanks for following up and thanks to the ScriptRunner folks for a real quick turnaround on this issue!

This widget could not be displayed.

Some examples. In this case, my interested issues are 'ISSUE1, ISSUE2...'

issueFunction in portfolioParentsOf('issueFunction in linkedIssuesOfAllRecursive("issue in (<ISSUE1>,<ISSUE2>,...)") and issuetype = Epic ') and issuetype = StakeHolder
issueFunction in portfolioParentsOf('issueFunction in linkedIssuesOfAllRecursive("issue in (<ISSUE1>,<ISSUE2>,...)") and issuetype = Epic ') and issuetype = Initiative

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

233 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you