Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-89716

Ability to import only issues whose Epic is in Portfolio already

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

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

      I want to be able to import all new stories from JIRA whose parent Epic is already in Portfolio.

      My situation:

      • I have a lot of stuff in JIRA that I don't want imported into Portfolio
      • In JIRA Portfolio, I onlynwant to track a specific set of Epics and all their child Stories (i.e. the ones the business cares about most, and where resourcing matters most)
      • Over time, as requirements evolve, new Stories are created in JIRA, and unless I can import these the plan will be wrong

      The problem:

      • When I go to import issues, I only want to see the ones that belong to an already imported Epic.
      • There is no filter I can write that will select only those issues whose parent is already imported in JIRA Portfolio.

            [JRACLOUD-89716] Ability to import only issues whose Epic is in Portfolio already

            This issue relates to Portfolio Classic Plans, which is no longer supported in Portfolio for JIRA Cloud. 

            Thanks,
            Bree

            Bree Davies added a comment - This issue relates to Portfolio Classic Plans, which is no longer supported in Portfolio for JIRA Cloud.  Thanks, Bree

            Thanks Doug! This is helpful and I may go this route... Atlassian when you have time to look at this, I would love to skip these extra steps

            Robert Strazzarino added a comment - Thanks Doug! This is helpful and I may go this route... Atlassian when you have time to look at this, I would love to skip these extra steps

            Doug Dixon added a comment -

            I spent some effort on a workaround that achieves what I want.

            1. Add a new value to the 'Flagged' custom field, which I think comes pre-configured with a single value, 'Impediment'. The new value should be called 'Sync to Portfolio'.
            2. Create a Calculated Text Field called 'Sync to Portfolio', with the following code as the description (weird place to put code, but that's how this custom field is configured). This keeps the 'Sync to Portfolio' custom field in sync with the value of the parent epic's 'Sync to Portfolio' flag. Your custom fields will probably have different ids.

            <!-- @@Formula:
            
            /* If there's an Epic Link, go to that epic and seach the Flag values for "Sync to Portfolio".
            If found, returns "Yes", otherwise returns "No".
            */
            
            import com.atlassian.jira.issue.CustomFieldManager;
            import com.atlassian.jira.component.ComponentAccessor;
            import com.atlassian.jira.issue.fields.CustomField;
            import java.util.List;
            
            CustomFieldManager cfm = ComponentAccessor.getCustomFieldManager();
            CustomField flags_customfield = cfm.getCustomFieldObject(new Long(10100));
            
            String epic_link_fieldname = "customfield_10106";
            String sync_flag_value = "Sync to Portfolio";
            String yes = "Yes";
            String no = "No";
            
            if (issue.get(epic_link_fieldname) != null)
            {
              List flags = issue.get(epic_link_fieldname).getCustomFieldValue(flags_customfield);
              if (flags != null) {
                for (Object o : flags) {
                 if (o.getValue().equals(sync_flag_value))
                   return yes;
                }
              }
            }
            return no;
            -->
            

            3. Create a filter called 'Import to Portfolio' which you will use in Portfolio:

            (Flagged = "Sync to Portfolio" OR "Sync to Portfolio" ~ Yes) AND resolution = Unresolved
            

            4. Set the 'Sync to Portfolio' flag on all epics you'd like to see in Portfolio
            5. Reindex and confirm you can see the 'Sync to Portfolio' custom field saying 'Yes' for child stories of those epics
            6. Import in Portfolio using the above filter
            7. Open another beer

            Notes:

            • I named the flag value and the custom field the same thing; you don't have to.
            • If you hit problems, catalina.out will help you debug it

            Further steps:

            • To only show the 'Flagged' field on the edit screen for Epics only (and not Stories - it would be confusing to have 2 places to see 'Sync to Portfolio', with potentially conflicting information), I made a 'Default screen for Epics' that includes the 'Flagged' field, and a corresponding 'Epic screen scheme' and 'Epic issue type screen scheme'. Finally, my 'Projects' project in JIRA is associated with this Issue Type Screen Scheme and the spell is complete.
              • Note: All my Epics are in a single project called Projects, all other projects have the actual stories, but cannot have Epics. This fits one of Portfolio's ways of working with Epics/Stories.

            Doug Dixon added a comment - I spent some effort on a workaround that achieves what I want. 1. Add a new value to the 'Flagged' custom field, which I think comes pre-configured with a single value, 'Impediment'. The new value should be called 'Sync to Portfolio'. 2. Create a Calculated Text Field called 'Sync to Portfolio', with the following code as the description (weird place to put code, but that's how this custom field is configured). This keeps the 'Sync to Portfolio' custom field in sync with the value of the parent epic's 'Sync to Portfolio' flag. Your custom fields will probably have different ids. <!-- @@Formula: /* If there's an Epic Link, go to that epic and seach the Flag values for "Sync to Portfolio" . If found, returns "Yes" , otherwise returns "No" . */ import com.atlassian.jira.issue.CustomFieldManager; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.fields.CustomField; import java.util.List; CustomFieldManager cfm = ComponentAccessor.getCustomFieldManager(); CustomField flags_customfield = cfm.getCustomFieldObject( new Long (10100)); String epic_link_fieldname = "customfield_10106" ; String sync_flag_value = "Sync to Portfolio" ; String yes = "Yes" ; String no = "No" ; if (issue.get(epic_link_fieldname) != null ) { List flags = issue.get(epic_link_fieldname).getCustomFieldValue(flags_customfield); if (flags != null ) { for ( Object o : flags) { if (o.getValue().equals(sync_flag_value)) return yes; } } } return no; --> 3. Create a filter called 'Import to Portfolio' which you will use in Portfolio: (Flagged = "Sync to Portfolio" OR "Sync to Portfolio" ~ Yes) AND resolution = Unresolved 4. Set the 'Sync to Portfolio' flag on all epics you'd like to see in Portfolio 5. Reindex and confirm you can see the 'Sync to Portfolio' custom field saying 'Yes' for child stories of those epics 6. Import in Portfolio using the above filter 7. Open another beer Notes: I named the flag value and the custom field the same thing; you don't have to. If you hit problems, catalina.out will help you debug it Further steps: To only show the 'Flagged' field on the edit screen for Epics only (and not Stories - it would be confusing to have 2 places to see 'Sync to Portfolio', with potentially conflicting information), I made a 'Default screen for Epics' that includes the 'Flagged' field, and a corresponding 'Epic screen scheme' and 'Epic issue type screen scheme'. Finally, my 'Projects' project in JIRA is associated with this Issue Type Screen Scheme and the spell is complete. Note: All my Epics are in a single project called Projects, all other projects have the actual stories, but cannot have Epics. This fits one of Portfolio's ways of working with Epics/Stories.

            +1 for this as well. I want to be able to click the "Import" button, type in a JIRA ticket ID which is an Epic, and then have it suggest to import all of the stories underneath that epic into portfolio.

            Robert Strazzarino added a comment - +1 for this as well. I want to be able to click the "Import" button, type in a JIRA ticket ID which is an Epic, and then have it suggest to import all of the stories underneath that epic into portfolio.

              Unassigned Unassigned
              c14040751b29 Doug Dixon
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: