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

Rank (obsolete) fields should be unlocked so that they can be deleted

    • 2
    • 14
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      After the update of JIRA Agile from 6.3.9.1 to 6.6.0, the "Rank" field was re-worked into a new Lexo rank field and the original field was re-named to "Rank (Obsolete)" as explained in the upgrade notes at : https://confluence.atlassian.com/display/AGILE/JIRA+Agile+6.4+Upgrade+Notes.

      Although it is safe to remove this field later, but the customer needs to go through the process of removing the field through the database. The upgrade process should automatically take care of deleting the field.

          Form Name

            [JSWSERVER-11228] Rank (obsolete) fields should be unlocked so that they can be deleted

            John Price added a comment -

            I'm not clear - is there some way to remove "Rank (Obsolete)" at this point, and is it safe?

            John Price added a comment - I'm not clear - is there some way to remove "Rank (Obsolete)" at this point, and is it safe?

            Version 7.1.4 and the field is still there.

            Atlassian should automatically remove deprecated fields.

            Carlos Henriques added a comment - Version 7.1.4 and the field is still there. Atlassian should automatically remove deprecated fields.

            Atlassian, I'm really puzzled by this issue: Is it Atlassian's intention that JIRA users see this useless field forever? Why doesn't the upgrade just delete it?

            CHD CM Support added a comment - Atlassian, I'm really puzzled by this issue: Is it Atlassian's intention that JIRA users see this useless field forever? Why doesn't the upgrade just delete it?

            Bob Swift added a comment - - edited

            Why hasn't this field been automatically removed from Cloud instances???

            Bob Swift added a comment - - edited Why hasn't this field been automatically removed from Cloud instances???

            JamieA added a comment -

            I had this issue recently and couldn't find the comments on the linked page. If you do have ScriptRunner installed, the script, that you can run from script console, is:

            import com.atlassian.jira.bc.JiraServiceContextImpl
            import com.atlassian.jira.bc.customfield.CustomFieldService
            import com.atlassian.jira.component.ComponentAccessor
            
            def customFieldManager = ComponentAccessor.customFieldManager
            def customFieldService = ComponentAccessor.getComponent(CustomFieldService)
            
            def currentUser = ComponentAccessor.getJiraAuthenticationContext().user
            def serviceContext = new JiraServiceContextImpl(currentUser)
            
            customFieldManager.getCustomFieldObjectsByName("Rank").findAll {
                it.customFieldType.descriptor.moduleClass.name == "com.atlassian.greenhopper.customfield.rank.RankCFType"
            }.each { cf ->
                customFieldService.validateDelete(serviceContext, cf.idAsLong)
            
                def errors = serviceContext.errorCollection
                if (errors.hasAnyErrors()) {
                    log.warn ("Can't delete field: ${cf.id}")
                }
                else {
                    customFieldManager.removeCustomField(cf)
                }
            }
            

            JamieA added a comment - I had this issue recently and couldn't find the comments on the linked page. If you do have ScriptRunner installed, the script, that you can run from script console, is: import com.atlassian.jira.bc.JiraServiceContextImpl import com.atlassian.jira.bc.customfield.CustomFieldService import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.customFieldManager def customFieldService = ComponentAccessor.getComponent(CustomFieldService) def currentUser = ComponentAccessor.getJiraAuthenticationContext().user def serviceContext = new JiraServiceContextImpl(currentUser) customFieldManager.getCustomFieldObjectsByName( "Rank" ).findAll { it.customFieldType.descriptor.moduleClass.name == "com.atlassian.greenhopper.customfield.rank.RankCFType" }.each { cf -> customFieldService.validateDelete(serviceContext, cf.idAsLong) def errors = serviceContext.errorCollection if (errors.hasAnyErrors()) { log.warn ( "Can't delete field: ${cf.id}" ) } else { customFieldManager.removeCustomField(cf) } }

            You can find a KB entry at https://confluence.atlassian.com/display/AGILEKB/How+to+unlock+a+Locked+field but it required database modifications (not easily possible in a seciruty concerned company where JIRA admins are not the same as DB admins).
            In the comments, there are solutions using a script runner, but this requires the additional plug-in to be installed.
            I would prefer if the update would complete the job and unlock the fields, so a workaround is not necessary.

            Hans-Jürgen Tappe added a comment - You can find a KB entry at https://confluence.atlassian.com/display/AGILEKB/How+to+unlock+a+Locked+field but it required database modifications (not easily possible in a seciruty concerned company where JIRA admins are not the same as DB admins). In the comments, there are solutions using a script runner, but this requires the additional plug-in to be installed. I would prefer if the update would complete the job and unlock the fields, so a workaround is not necessary.

            I agree with Hans – I don't mind deleting the field by hand, but it is locked and I can't puzzle out a way to unlock it.

            Mark Stracka added a comment - I agree with Hans – I don't mind deleting the field by hand, but it is locked and I can't puzzle out a way to unlock it.

            This is less a task than a Bug, regarding that the upgrade documentation is inconsistent with the tool behavior (the user is not able to follow the "delete" instructions because the field is locked).

            Hans-Jürgen Tappe added a comment - This is less a task than a Bug , regarding that the upgrade documentation is inconsistent with the tool behavior (the user is not able to follow the "delete" instructions because the field is locked ).

            Actually, it is OK to let the user remove the field from the administration front-end and not auto-remove the field in the upgrade process.

            But the user cannot delete the field because it is still locked.

            So what is required instead, is that the upgrade removes the "locked" (managed) state of the obsoleted field, so the user has the possibility to delete the field if he wants from the administration frontend. Assuming the upgrade removed the "locked" (managed) state, the upgrade documentation will become correct again.

            Thanks.

            Hans-Jürgen Tappe added a comment - Actually, it is OK to let the user remove the field from the administration front-end and not auto-remove the field in the upgrade process. But the user cannot delete the field because it is still locked . So what is required instead, is that the upgrade removes the "locked" (managed) state of the obsoleted field, so the user has the possibility to delete the field if he wants from the administration frontend. Assuming the upgrade removed the "locked" (managed) state, the upgrade documentation will become correct again. Thanks.

              Unassigned Unassigned
              rtandon@atlassian.com Ruchi Tandon
              Votes:
              56 Vote for this issue
              Watchers:
              47 Start watching this issue

                Created:
                Updated: