Uploaded image for project: 'Advanced Roadmaps'
  1. Advanced Roadmaps
  2. JPOSERVER-1883

JQL support for Multi level Parent Link

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • 2.10.0
    • Integration
    • None
    • JIRA feedback is collected from a number of different sources and is evaluated when planning the product roadmap. If you would like to know more about how JIRA Product Management uses customer input during the planning process, please see our post on Atlassian Answers.

      NOTE: This suggestion is for JIRA Portfolio Server. Using JIRA Portfolio Cloud? See the corresponding suggestion.

      Hi,

      I have the following Hierarchy in portfolio.

      Theme  -> Initiative -> Epic ->Story

      The Theme issue type has a custom field by which I want to query the Initiatives, Epics and Stories within the Theme that has a particular value for the custom field. Is this currently possible?

            [JPOSERVER-1883] JQL support for Multi level Parent Link

            Hi @rchristian,

            Thanks for the information. Are there plans to expand the capabilities of the childIssuesOf () JQL function? It'd be great to query all issues linked to ALL initiatives that live in a project dedicated to Portfolio items above the Epic hierarchy. For example, issuekey in childIssuesOf ("project = ABC") where the ABC project contains Initiatives, and the JQL returns all Epics, Stories, and Sub-tasks linked back to those Initiatives.

            We can achieve this using four filters in Scriptrunner's JQL functions, but it'd be great if Portfolio's JQL could handle it in one.

            JQL Via Scriptrunner

            Filter 1 (Get Epics linked to parent Initiatives) - issueFunction in portfolioChildrenOf("project = ABC")

            Filter 2 (Get Stories linked to those Epics) - issueFunction in linkedIssuesOfAll ("Filter 1")

            Filter 3 (Get Sub-tasks linked to those Stories) - issueFunction in subtasksOf("Filter 2")

            Filter 4 (Final) - issueFunction in linkedIssuesOfAll ("Filter 1") OR issueFunction in subtasksOf("Filter 2") ORDER BY Rank ASC

            Best,

            Cameron

            cc @nriley1

            Cameron Eldridge added a comment - Hi @rchristian, Thanks for the information. Are there plans to expand the capabilities of the  childIssuesOf () JQL function? It'd be great to query all issues linked to ALL initiatives that live in a project dedicated to Portfolio items above the Epic hierarchy. For example, issuekey in childIssuesOf ("project = ABC")  where the ABC project contains Initiatives, and the JQL returns all Epics, Stories, and Sub-tasks linked back to those Initiatives. We can achieve this using  four  filters in Scriptrunner's JQL functions, but it'd be great if Portfolio's JQL could handle it in one . JQL Via Scriptrunner Filter 1  (Get Epics linked to parent Initiatives) - issueFunction in portfolioChildrenOf(" project = ABC ") Filter 2 (Get Stories linked to those Epics) -  issueFunction in linkedIssuesOfAll (" Filter 1 ") Filter 3  (Get Sub-tasks linked to those Stories) -  issueFunction in subtasksOf(" Filter 2 ") Filter 4  (Final) -  issueFunction in linkedIssuesOfAll (" Filter 1 ") OR issueFunction in subtasksOf(" Filter 2 ") ORDER BY Rank ASC Best, Cameron cc @nriley1

            Hey Rik,

            Good questions.

            1. Yes the parameter only takes 1 issue key. So the JQL example you've provided wouldn't work with this implementation. Is the specific example you've provided something you're trying to achieve (to surface every issue that's associated to an open initiative)? If so could you please clarify your need to help us understand what you'd want to achieve with this result? What would you do with the output?
            2. Yes we're currently in development for functionality to perform parentissueof equivalent that return hierarchy results bottom up.

            Thanks for the feedback.
            Cheers,

            Rhys

            Rhys Christian added a comment - Hey Rik, Good questions. Yes the parameter only takes 1 issue key. So the JQL example you've provided wouldn't work with this implementation. Is the specific example you've provided something you're trying to achieve (to surface every issue that's associated to an open initiative)? If so could you please clarify your need to help us understand what you'd want to achieve with this result? What would you do with the output? Yes we're currently in development for functionality to perform parentissueof equivalent that return hierarchy results bottom up. Thanks for the feedback. Cheers, Rhys

            Hi Rhys, 

            I've read through the documentation. It sounds pretty good. I have 2 questions:

            1) does the 'issuekey in childIssuesOf()' only take 1 issuekey as parameter? Or can it also take JQL as parameter (EG: issuekey in childIssuesOf(issuetype = Initiative and status = 'In progress')?

            2) will there also be a parentIssuesOf equivalent? 

            Cheers, Rik

            Rik de Valk added a comment - Hi Rhys,  I've read through the documentation. It sounds pretty good. I have 2 questions: 1) does the 'issuekey in childIssuesOf()' only take 1 issuekey as parameter? Or can it also take JQL as parameter (EG: issuekey in childIssuesOf(issuetype = Initiative and status = 'In progress')? 2) will there also be a parentIssuesOf equivalent?  Cheers, Rik

            Hey Portfolians,

            In our latest Portfolio for Jira Server 2.10 release (Download here) we’ve implemented new JQL functionality that allows you to filter/search all issues in the hierarchy (i.e children, grandchildren, great-grandchildren etc.).

            The documentation can be found here in the section For searching issues within the hierarchy under the subheading For child issues of an issue:
            https://confluence.atlassian.com/jiraportfolioserver/searching-for-issues-using-portfolio-issue-details-940678957.html

            This functionality should provide the value requested in this ticket.
            We’re keen to hear your thoughts, any issues and whether the new JQL assists with your use cases.

            Cheers,
            Rhys | Portfolio for Jira Server PM

            Rhys Christian added a comment - Hey Portfolians, In our latest Portfolio for Jira Server 2.10 release ( Download here ) we’ve implemented new JQL functionality that allows you to filter/search all issues in the hierarchy (i.e children, grandchildren, great-grandchildren etc.). The documentation can be found here in the section For searching issues within the hierarchy under the subheading For child issues of an issue: https://confluence.atlassian.com/jiraportfolioserver/searching-for-issues-using-portfolio-issue-details-940678957.html This functionality should provide the value requested in this ticket. We’re keen to hear your thoughts, any issues and whether the new JQL assists with your use cases. Cheers, Rhys | Portfolio for Jira Server PM

            Hi @Neal,

            Thanks for your support. I have created a ticket https://productsupport.adaptavist.com/servicedesk/customer/portal/2/SRJSUP-3202 for my use case as you advised. Please let me know if you need more information on https://productsupport.adaptavist.com/browse/SRJIRA-2551.

            I understand that this is the behaviour of Jira Portfolio not an issue wiht Scriptrunner, but is there a lastest updated timestamp that can drive the query results, to just retrieve the latest parent link field value?

            Thanks and Regards,

            Gowri

            Gowri Kumar added a comment - Hi @Neal, Thanks for your support. I have created a ticket https://productsupport.adaptavist.com/servicedesk/customer/portal/2/SRJSUP-3202  for my use case as you advised. Please let me know if you need more information on  https://productsupport.adaptavist.com/browse/SRJIRA-2551 . I understand that this is the behaviour of Jira Portfolio not an issue wiht Scriptrunner, but is there a lastest updated timestamp that can drive the query results, to just retrieve the latest parent link field value? Thanks and Regards, Gowri

            Neal Riley added a comment -

            Hi @Gowri, 

            You can nest queries using portfolioChildrenOf and portfolioParentsOf, which will allow you to traverse this hierarchy. Ping us over on productsupport.adaptavist.com and we'd be happy to help you work out what you are trying to do. 

            For your example, this is interesting, if you're correct this is something that unfortunately ScriptRunner is bound to the Atlassian APIs with, but still would be interesting to take a look.  I've created an issue in the backlog for us to take a look at, in case this is something we can work around: https://productsupport.adaptavist.com/browse/SRJIRA-2551

            For anyone who is interested, if you find this bug report in the future, we have written up a few ways to use the new portfolioChildrenOf and portfolioParentOf JQL functions in ScriptRunner here: http://www.adaptavist.com/w/how-to-customise-and-simplify-portfolio-for-jira-with-scriptrunner/

            Neal Riley

            Product Manager, ScriptRunner

            Neal Riley added a comment - Hi @Gowri,  You can nest queries using portfolioChildrenOf and portfolioParentsOf, which will allow you to traverse this hierarchy. Ping us over on productsupport.adaptavist.com and we'd be happy to help you work out what you are trying to do.  For your example, this is interesting, if you're correct this is something that unfortunately ScriptRunner is bound to the Atlassian APIs with, but still would be interesting to take a look.  I've created an issue in the backlog for us to take a look at, in case this is something we can work around: https://productsupport.adaptavist.com/browse/SRJIRA-2551 For anyone who is interested, if you find this bug report in the future, we have written up a few ways to use the new portfolioChildrenOf and portfolioParentOf JQL functions in ScriptRunner here: http://www.adaptavist.com/w/how-to-customise-and-simplify-portfolio-for-jira-with-scriptrunner/ Neal Riley Product Manager, ScriptRunner

            Gowri Kumar added a comment - - edited

            I have tried the portfolioChildrenOf() and portfolioparentsOf() which work well for what I need. But, this retrieves only one level of hierarchy.

            Also, there seems to be an issue with Portfolio itself not clearing "Parent Link" field when an issue is moved from Epic Level and above to Story Level and below. This causes the JQL query with portfolioChildrenOf() and portfolioparentsOf() incorrectly retrieve those issues as well, which is incorrect.

            For example,

            1. I have an Epic with "Parent Link" set to Initiative (say DEMO-1).
            2. I move the Epic as a Story (this movement between Epic and Story occurs frequently in our projects).
            3. Now, when I run the JQL "issueFunction in portfolioChildrenOf("key=DEMO-1"), I can still see the Story as child of the initiative DEMO-1, which is incorrect.
            4. The workaround was to move back the Story to Epic, clear the "Parent Link" Field, and then move it to Story again.

            There seems to be a problem when moving issues, JIRA/Portfolio is NOT cleaning up the data in all places.

            This is a problem for all issues that had a change in "Parent Link". It shows up on the JQL for children for both old and new parent items.

            Regards,
            Gowri

            Gowri Kumar added a comment - - edited I have tried the portfolioChildrenOf() and portfolioparentsOf() which work well for what I need. But, this retrieves only one level of hierarchy. Also, there seems to be an issue with Portfolio itself not clearing "Parent Link" field when an issue is moved from Epic Level and above to Story Level and below. This causes the JQL query with portfolioChildrenOf() and portfolioparentsOf() incorrectly retrieve those issues as well, which is incorrect. For example, I have an Epic with "Parent Link" set to Initiative (say DEMO-1). I move the Epic as a Story (this movement between Epic and Story occurs frequently in our projects). Now, when I run the JQL "issueFunction in portfolioChildrenOf("key=DEMO-1"), I can still see the Story as child of the initiative DEMO-1, which is incorrect. The workaround was to move back the Story to Epic, clear the "Parent Link" Field, and then move it to Story again. There seems to be a problem when moving issues, JIRA/Portfolio is NOT cleaning up the data in all places. This is a problem for all issues that had a change in "Parent Link". It shows up on the JQL for children for both old and new parent items. Regards, Gowri

            Hi rikdevalk and other voters on this ticket,

            Just wanted to inform you that Adaptavist's ScriptRunner add-on has implemented JQL functionality for Portfolio for JIRA's Parent link field in their 5.0.11 update.

            Find instructions on how to use the JQL functions here: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_portfolio
            With current JQL Functions and this new set of functions, you should be able to fully traverse the hierarchy and filter for all children, grand children and great grandchildren (etc.) of your hierarchy..

            We acknowledge a native solution is preferable to many however we won't be able to provide one for some time. For now we're interested in whether this functionality works for you and share the info so you're aware of the value if you have access to Scriprunner.
            We're keen to get feedback - does it help achieve your use case? What are the problems / what's missing?

            Thanks,

            Rhys Christian | Portfolio for JIRA Product Management

            Rhys Christian added a comment - Hi rikdevalk and other voters on this ticket, Just wanted to inform you that Adaptavist's ScriptRunner add-on has implemented JQL functionality for Portfolio for JIRA's Parent link field in their 5.0.11 update. Find instructions on how to use the JQL functions here: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_portfolio With current JQL Functions and this new set of functions, you should be able to fully traverse the hierarchy and filter for all children, grand children and great grandchildren (etc.) of your hierarchy.. We acknowledge a native solution is preferable to many however we won't be able to provide one for some time. For now we're interested in whether this functionality works for you and share the info so you're aware of the value if you have access to Scriprunner. We're keen to get feedback - does it help achieve your use case? What are the problems / what's missing? Thanks, Rhys Christian | Portfolio for JIRA Product Management

            This is a critical feature in my opinion. I'd like to elaborate a bit on this one: 

            As a JIRA Software user I want to be able to filter (JQL) all issues that are children, grandchildren and great-grandchildren (down to sub-task level) from one or multiple issues (based on a sub-query) so that I can have insight in all work that contributes to shared objective(s).

            A Portfolio Plan doesn't solve this use-case in organisations with large numbers of teams and many dependencies. In our organisation there are hundreds of teams. And there is no way to create a Portfolio Plan that spans all of these teams (and I would like to have such a plan either). So we use Portfolio Plans for Teams-of-Teams, but have dozens of Teams-of-Teams. Multiple Teams from multiple Teams-of-Teams will contribute to Themes. Currently there is no way to get insight in all issues that contribute to these Themes. 

            For example (following the hierarchy levels that Gowri listed):

            • There are a total of 100 issues of the issuetype Theme. 
            • From these 100 there are 10 Themes that contain value "501" in custom field "Legion". 
            • Below these 10 Themes there are 24 Initiatives that are spread across multiple Teams-of-Teams. 
            • And below these 24 Initiatives there are 150 Epics spread across 30 Teams

            To gain insight into the total status, progress and plan of these 501st Legion Themes we need to filter all User Stories that belong to these 150 Epics. But currently there is no easy way to this!

            Must-have feature for Portfolio in large organisations!!! 

            By the way: If Parent Link would create an Issue Link (similar to what an Epic Link does) it would be possible to use ScripRunner linkedIssuesOf() in a nested query to get these results. But it would be better if Portfolio for JIRA would offer such functionality itself. 

            Rik de Valk added a comment - This is a critical feature in my opinion. I'd like to elaborate a bit on this one:  As a JIRA Software user I want to be able to filter (JQL) all issues that are children, grandchildren and great-grandchildren (down to sub-task level) from one or multiple issues (based on a sub-query) so that I can have insight in all work that contributes to shared objective(s). A Portfolio Plan doesn't solve this use-case in organisations with large numbers of teams and many dependencies. In our organisation there are hundreds of teams. And there is no way to create a Portfolio Plan that spans all of these teams (and I would like to have such a plan either). So we use Portfolio Plans for Teams-of-Teams, but have dozens of Teams-of-Teams. Multiple Teams from multiple Teams-of-Teams will contribute to Themes. Currently there is no way to get insight in all issues that contribute to these Themes.  For example (following the hierarchy levels that Gowri listed): There are a total of 100 issues of the issuetype Theme.  From these 100 there are 10 Themes that contain value "501" in custom field "Legion".  Below these 10 Themes there are 24 Initiatives that are spread across multiple Teams-of-Teams.  And below these 24 Initiatives there are 150 Epics spread across 30 Teams To gain insight into the total status, progress and plan of these 501st Legion Themes we need to filter all User Stories that belong to these 150 Epics. But currently there is no easy way to this! Must-have feature for Portfolio in large organisations!!!  By the way: If Parent Link would create an Issue Link (similar to what an Epic Link does) it would be possible to use ScripRunner linkedIssuesOf() in a nested query to get these results. But it would be better if Portfolio for JIRA would offer such functionality itself. 

              Unassigned Unassigned
              ed44d60068b3 Gowri Kumar
              Archiver:
              atibrewal@atlassian.com Aakrity Tibrewal

                Created:
                Updated:
                Resolved:
                Archived: