Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-5544

Script Fragment 'Hide system or plugin UI element’ implementation with Uncaught TypeError exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 6.5.0
    • Fix Version/s: None
    • Component/s: Fragments
    • Labels:
      None
    • Critical Points:
      2.3

      Description

      A Script Fragment 'Hide system or plugin UI element’ implementation to hide project sidebar caused an Uncaught TypeError exception for the users that the sidebar is hidden from, specifically when the user tried to view the project boards (Scrum/Kanban).

      Steps to Reproduce the Problem

      Prerequisites

      1. Create a group called 'sample-group'
        Jira Administration > User management > Groups > Add group: input 'sample-group' as group name and click on 'Add group' button
      2. Click on the 'Edit members' action on the group created > input your currently logged-on username > click on 'Add selected users' button
      1. Navigate to Fragments > click 'Create Script Fragment' > select 'Hide system or plugin UI element'
      2. For Hide what field, select com.atlassian.jira.jira-projects-plugin:sidebar-panel
      3. For Condition, input the script below > click 'Add'
        import com.atlassian.jira.component.ComponentAccessor
        def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
        def groupManager = ComponentAccessor.getGroupManager()
        
        return !(groupManager.isUserInGroup(currentUser,"sample-group"))
        
      4. Click on 'Projects' on the top ribbon > select current project. This will bring you to the Backlog page. Alternatively, you may directly access the project board via the URL e.g. http://localhost:8080/secure/RapidBoard.jspa?rapidView=1.
        A dialog with these errors would pop up:

        An error occurred
        Please try refreshing the page, or contact your administrator / Atlassian Support if the problem continues.

        Details

      Expected Behaviour

      Users are able to view the project board despite the hidden project sidebar.

      Actual Behaviour

      Users encounter errors when viewing project board with project sidebar that is hidden from them.

      Additional Info

      • Reproduced in Jira Software 8.19.0 | ScriptRunner 6.34.0
      • Complete error message:
        An error occurred
        
        Please try refreshing the page, or contact your administrator / Atlassian Support if the problem continues.
        
        Details
        Exception: Uncaught TypeError: Cannot read properties of undefined (reading 'top')
        Resource: http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true
        Line: 1310
        Column: 902
        
        Environment
        Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
        
        Stack trace
        TypeError: Cannot read properties of undefined (reading 'top')
        at g (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:1310:902)
        at m.reflow (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:1310:10275)
        at n.M.handleResizeEvent (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:9898:7395)
        at n.M.updateContentContainer (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:9898:7233)
        at Object.V.initializePlanMode (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:6388:3074)
        at Object. (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:190:8)
        at Object.initializePlanMode (http://localhost:8080/s/0fc372fb86f08e37a9f12cb48d0a6f27-CDN/-feciwo/819000/1dlckms/c95955c3a0b2b5bb35a047ca6970ceb9/_/download/contextbatch/js/_super/batch.js?locale=en-US:961:21)
        at Object. (http://localhost:8080/s/056e1317969548bf81e8ece90727a2e7-CDN/-feciwo/819000/1dlckms/294f1afdffac4512775afe9a3e4a6088/_/download/contextbatch/js/gh-rapid-plan,greenhopper-rapid-non-gadget,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,jira.general,-_super/batch.js?agile_global_admin_condition=true&baseurl-check-resources=true&flexboards=true&healthcheck-resources=true&jag=true&jaguser=true&locale=en-US&whisper-enabled=true:6388:2657)
        at i (http://localhost:8080/s/0fc372fb86f08e37a9f12cb48d0a6f27-CDN/-feciwo/819000/1dlckms/c95955c3a0b2b5bb35a047ca6970ceb9/_/download/contextbatch/js/_super/batch.js?locale=en-US:54:22867)
        at Object.add [as done] (http://localhost:8080/s/0fc372fb86f08e37a9f12cb48d0a6f27-CDN/-feciwo/819000/1dlckms/c95955c3a0b2b5bb35a047ca6970ceb9/_/download/contextbatch/js/_super/batch.js?locale=en-US:54:23187)
        

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            wkoh Winnie Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: