Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-24811

The Parent Link field is not cleared when the Issue Type is changed and the Link isn't valid anymore

      Issue Summary

      When an issue has a Parent Link and its issue type is changed to a type on another hierarchy level, the Parent Link data remains. Consequently, the Parent Link is still visible on the issue view with a warning icon that suggests the Parent Link violates the current Hierarchy configuration and should be updated by the user.

      This issue is worsened when an Epic Link is also present on the Issue that had the Issue Type changed. The presence of an Epic Link makes Jira automatically hide the Parent Link from the Screens and makes it harder to remove the leftover data.

      This issue can lead to unexpected and unusual behaviour in Jira. For instance, JQL queries may produce results that differ from what is anticipated. For example, 3rd party app that provides JQL functions to iterate over the Issue hierarchy (linkedIssuesOfRecursive) and can return a different set of issues than Jira functions like(childIssuesOf).

      Steps to Reproduce

      Scenario 1

      1. Create a new issue type called 'Initiative'
      2. Configure the hierarchy to be above Epic (at the top level)
      3. Create a new issue with the issue type 'Initiative'
      4. Link an Epic to the new Initiative using the parent link
      5. Open the Epic and use More > Move to change the issue type to 'Initiative'

      Scenario 2 (inconsistent results returned from childIssuesOf(...) query)

      1. Create a new project.
      2. Configure the hierarchy like this:
        - EpicBusiness
        -- Capability
        --- Epic
        ----Story 
        

      A) The experienced Issue follows the below scenario ...

      • The Capability CAP-100 has the EpicBusiness EPB-100 as Parent.
      • The Epic EP-100 has CAP-100 as Parent
      • The JQL
        issue in childIssuesOf(EPB-100)
        returns CAP-100 and all its child : Epic (EP-100), User Story (...), Sub-Task (...)

      B) A user move CAP-100 as an EpicBusiness : EPB-110

      • The JQL
        issue in childIssuesOf(EPB-110)
        returns always same children as when it was CAP-100
      • The Epic EP-100 has EPB-110 as direct Parent, an EpicBusiness ! Normally, only Capabilities should be allowed as Parent of Epic
      • The JQL
        issue in childIssuesOf(EPB-100)
        returns always same children, including EPB-110 (ex-CAP-100) ! Normally, an EpicBusiness can not have a EpicBusiness as Parent.

      It is causing many inconsistencies in the users activities

      Scenario 3 (involved 3rd party plugin)

      1. Install a 3rd party app that provides JQL functions to iterate over Issue hierarchy

      2. Create Issue Types "Initiative" and "Capability" and add them to a Project's Scheme

      3. Add the Parent Link Custom Field to all Screens on that Project (to make it easier to follow the steps)

      4. Configure the Roadmaps Hierarchy so that Initiative > Capability > Epic

      5. Create a set of Issues organized as such:

      Initiative 1
        Capability 1
          Epic 1
      	  Story 1
        Capability 2
          Epic 2
      	  Story 2
      
      Epic 3
        Story 3
      

      6. Create a Filter using the 3rd party app JQL function to list the Hierarchy of the top Issue, like:

      issue = "<Initiative 1 Issue Key>" OR issueFunction in linkedIssuesOfRecursive("<Initiative 1 Issue Key>", "is parent of")
      

      7. Confirm all Issues under the hierarchy of "Initiative 1" are listed

      8. Change the Issue Type of "Capability 2" to Story (Move operation also works) and set it's Epic Link to "Epic 3"

      9. Reload the Filter and see "Capability 2" (now a Story) is still being listed, though it's now in the Hierarchy of "Epic 3", not under "Initiative 1"

      If you use Jira's native JQL functions, the Epic Link has precedence over the (invalid) Parent Link and "Capability 2" is not listed anymore:

      issue = "<Initiative 1 Issue Key>" OR issue in childIssuesOf("<Initiative 1 Issue Key>")
      

      Expected Results

      • The parent link will be cleared as you should be able to only link an issue to a parent issue of the corresponding hierarchy level that you've configured for your plan.
      • A Move Issue with change of Type (in Roadmap Hierarchy) must break all Parent Links or be blocked while a Parent-Child link exists
      • A Move Issue between JSW Issue Types and JPO Issue Types should be follow same rule
      • The JQL childIssueOf() should return children in respect of Hierarchies. Parent Link between Issue Type in same Level hierarchy should be ignored.

      Actual Results

      • The parent link data remains and the warning below can be seen next to this field:
        This link is inconsistent with your Portfolio hierarchy.
        
      • The parent link can't be edited as there is still Epic Link
      • The "Capability" Issue has a valid Epic Link which is prioritized by Jira and an invalid Parent Link which is ignored.
      • The data is still left over in both DB tables:
        issuelink
        entity_property 
      • The JQL childIssueOf() return the same results after move the ticket to another parent hierarchy issue type.

      Workaround

      1. Create an automation to remove the Parent Link

      Create an automation rule that will automatically clear the Parent Link field whenever an issue is moved to a new issue type, as explained in the KB article linked below:

      2. Remove Parent Link manually

      To remove the parent link: 

      • Convert the issue back to its previous issue type(e.g. Epic).
      • Remove the parent link. 
      • Convert back to the new issue type.

      3. Remove existing data directly from the database

      To clean up existing Issues' Parent Links refer to this documentation:

          Form Name

            [JSWSERVER-24811] The Parent Link field is not cleared when the Issue Type is changed and the Link isn't valid anymore

            Dear all,
            I would like to inform you that this issue in the project JPOSERVER is being migrated to the new project JSWSERVER. Your votes and comments will remain unchanged.
            Our team at Atlassian will continue to monitor this issue for further updates, so please feel free to share your thoughts or feedback in the comments.
            Sincerely,
            Aakrity Tibrewal
            Jira DC

            Aakrity Tibrewal added a comment - Dear all, I would like to inform you that this issue in the project JPOSERVER is being migrated to the new project JSWSERVER. Your votes and comments will remain unchanged. Our team at Atlassian will continue to monitor this issue for further updates, so please feel free to share your thoughts or feedback in the comments. Sincerely, Aakrity Tibrewal Jira DC

            Stasiu added a comment -

            Dear all,

            I would like to inform you that the Jira DC Development team has reviewed the following issues: JPOSERVER-2059, JSWSERVER-21939, JPOSERVER-2895, JPOSERVER-4360 and JPOSERVER-7116. After careful consideration, we have determined that they describe the same issue. Therefore, all issues will be merged into JPOSERVER-2059, while the other issues will be closed. If you would like to keep track of the problem, please vote and watch JPOSERVER-2059.

            Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts or feedback in the comments.

            Sincerely,
            Daniel Dudziak
            Jira DC Senior Software Engineer

            Stasiu added a comment - Dear all, I would like to inform you that the Jira DC Development team has reviewed the following issues: JPOSERVER-2059 , JSWSERVER-21939 , JPOSERVER-2895 , JPOSERVER-4360 and JPOSERVER-7116 . After careful consideration, we have determined that they describe the same issue. Therefore, all issues will be merged into JPOSERVER-2059 , while the other issues will be closed. If you would like to keep track of the problem, please vote and watch JPOSERVER-2059 . Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts or feedback in the comments. Sincerely, Daniel Dudziak Jira DC Senior Software Engineer

            Julien Rey added a comment -

            Workaround

            Create an automation rule that will automatically clear the Parent Link field whenever an issue is moved to a new issue type, as explained in the KB article linked below:
            https://confluence.atlassian.com/jirakb/automation-for-jira-how-to-clear-the-parent-link-field-when-an-issue-is-moved-to-a-new-type-1206795140.html

            Julien Rey added a comment - Workaround Create an automation rule that will automatically clear the Parent Link field whenever an issue is moved to a new issue type, as explained in the KB article linked below: https://confluence.atlassian.com/jirakb/automation-for-jira-how-to-clear-the-parent-link-field-when-an-issue-is-moved-to-a-new-type-1206795140.html

            Richard Cross added a comment - - edited

            Same issue for me as Kathleen Black above - it looks like a user has created Epics under a parent Initiative... and then converted those Epics to Initiatives.  And now they themselves have Epics underneath them.

            Neither the issue view, issue edit nor bulk edit screens will allow me to clear the field.

            However the fix from Mihai Schwarz is quick and works.  You don't even need to assign an issue type to the dummy entry you create.

            Richard Cross added a comment - - edited Same issue for me as Kathleen Black above - it looks like a user has created Epics under a parent Initiative... and then converted those Epics to Initiatives.  And now they themselves have Epics underneath them. Neither the issue view, issue edit nor bulk edit screens will allow me to clear the field. However the fix from Mihai Schwarz is quick and works.  You don't even need to assign an issue type to the dummy entry you create.

            Kathleen Black added a comment - - edited

            I have this same issue and I do not know how to access the Portfolio Admin for the suggested fix nor do I want it changed for all Initiatives. Our Hierarchy is Initiative > Epic -> Story -> Sub-Task.  Someone linked 3 Initiatives under one "parent" initiative. We are having trouble removing the 3 initiatives and unlinking them from the parent initiative. 

            Kathleen Black added a comment - - edited I have this same issue and I do not know how to access the Portfolio Admin for the suggested fix nor do I want it changed for all Initiatives. Our Hierarchy is Initiative > Epic -> Story -> Sub-Task.  Someone linked 3 Initiatives under one "parent" initiative. We are having trouble removing the 3 initiatives and unlinking them from the parent initiative. 

            This definitely causes incorrect outputs in our filters and structures. It is very difficult to repair because I cannot play around with the Portfolio hierarchy while thousands of users are working with that.

            Simone Kaiser added a comment - This definitely causes incorrect outputs in our filters and structures. It is very difficult to repair because I cannot play around with the Portfolio hierarchy while thousands of users are working with that.

            In my situation I fixed by:

            1. removing the Epic Link from the Story - which revealed the Parent Link (with the warning icon)
            2. removing Parent Link
            3. re-assigning Epic Link

             

            BTW, this can't be done via Bulk Edit since, for some reason, the Issue Search and Bulk Edit recognize the fact that the Parent Link is invalid and, therefore, don't show it in search results or allow it to be set to Empty in a Bulk Edit.  

            Preventative medicine... make sure Epics and Stories use different screen schemes (even better, remove issue type from the screens).  That way users won't be able to turn an Epic into a Story, which is what made this issue manifest in our system.

            Definitely +1ing this one.

             

            Jordan Janis added a comment - In my situation I fixed by: removing the Epic Link from the Story - which revealed the Parent Link (with the warning icon) removing Parent Link re-assigning Epic Link   BTW, this can't be done via Bulk Edit since, for some reason, the Issue Search and Bulk Edit recognize the fact that the Parent Link is invalid and, therefore, don't show it in search results or allow it to be set to Empty in a Bulk Edit.   Preventative medicine... make sure Epics and Stories use different screen schemes (even better, remove issue type from the screens).  That way users won't be able to turn an Epic into a Story, which is what made this issue manifest in our system. Definitely +1ing this one.  

            Thanks Mihai! Works perfectly.

            Just created a hierarchy above Initiative and saved changes. (Didn't bother to associate isssue types or change anything else)

            Went to the Initiative and cleared the Parent Link field. Reverted the changes back to original state in portfolio hierarchy.

            Worked like a charm

            Gowri Kumar added a comment - Thanks Mihai! Works perfectly. Just created a hierarchy above Initiative and saved changes. (Didn't bother to associate isssue types or change anything else) Went to the Initiative and cleared the Parent Link field. Reverted the changes back to original state in portfolio hierarchy. Worked like a charm

            Workaround: Change the hierarchy in Portfolio Administration, clear the parent link field, revert the changes you previously made.

            Mihai Schwarz added a comment - Workaround: Change the hierarchy in Portfolio Administration, clear the parent link field, revert the changes you previously made.

            We encountered this issue as well. Using Jira Data Center 7.10.2 with Portfolio version 2.21.0.

            Alex Christensen added a comment - We encountered this issue as well. Using Jira Data Center 7.10.2 with Portfolio version 2.21.0.

              b7eb103390a7 Nayan Kurude
              ed44d60068b3 Gowri Kumar
              Affected customers:
              59 This affects my team
              Watchers:
              55 Start watching this issue

                Created:
                Updated: