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:
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--
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. 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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.