Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-20331

NullPointerException when trying to map non-existent group in Notification Scheme to project role using Group to Project Role Mapping Tool

    XMLWordPrintable

Details

    Description

      Symptoms

      Stack trace (from 500 page):

      2010-02-03 17:12:19,980 http-8080-Processor23 [webwork.dispatcher.ServletDispatcher] Could not execute action
      java.lang.NullPointerException
      at com.atlassian.jira.scheme.mapper.SchemeTransformResult.addRoleMappingForGroup(SchemeTransformResult.java:126)
      at com.atlassian.jira.scheme.mapper.SchemeGroupsToRolesTransformerImpl.transformScheme(SchemeGroupsToRolesTransformerImpl.java:172)
      at com.atlassian.jira.scheme.mapper.SchemeGroupsToRolesTransformerImpl.doTransform(SchemeGroupsToRolesTransformerImpl.java:48)
      at com.atlassian.jira.bc.scheme.mapper.DefaultSchemeGroupsToRoleTransformerService.doTransform(DefaultSchemeGroupsToRoleTransformerService.java:41)
      at com.atlassian.jira.web.action.admin.scheme.mapper.SchemeGroupToRoleTransformerAction.doDefault(SchemeGroupToRoleTransformerAction.java:50)

      Steps to reproduce

      1. Create a group testgroup
      2. Add group to an event in Default Notification Scheme
      3. Delete group testgroup
      4. Go to Administration > Scheme Tools > Group to Project Role Mapping Tool
      5. From the dropdown select notification scheme and then from the list select Default Notification Scheme and then click Map Groups to Roles
      6. Next to the group testgroup select the dropdown Users and click Preview Mappings
      7. 500 page with exception is shown

      I guess this is a bug in two ways:

      • NullPointerException shouldn't be thrown. There should be some way of mapping out the non-existent group to a project role.
      • But more importantly, when you delete a group, it should delete associated scheme entities

      We should at least have a check for this in the Integrity Checker?

      Workaround

      As a workaround for this bug, we can remove the groups that no longer exists from the Notification schemes and Permission Schemes.

      We can find what schemes have non-existant groups by running the following queries on your database

      Notification Schemes:

      select NS.name,N.notif_parameter
      from notification N
      join notificationscheme NS on N.scheme=NS.id
      where N.notif_type = 'Group_Dropdown'
        and N.notif_parameter not in (select group_name from cwd_group)
      group by NS.name,N.notif_parameter
      

      Permission Schemes:

      select PS.name,P.perm_parameter
      from schemepermissions P
      join permissionscheme PS on P.scheme=PS.id
      where P.perm_type = 'group'
        and P.perm_parameter not in (select group_name from cwd_group)
      group by PS.name,P.perm_parameter
      

      Navigate on JIRA to the Notification/Permission scheme returned by the query and remove the groups specified by the queries.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mtokar Michael Tokar
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: