Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-1773

NPE while accessing Customer Portal when a status has been deleted from workflow

      NOTE: This bug report is for JIRA Service Desk Server. Using JIRA Service Desk Cloud? See the corresponding bug report.

      Steps to Reproduce:

      1. Have a JSD project
      2. Access the customer portal - it should be all ok
      3. Add a status on the workflow (e.g.: Atlassian Test Status) > Publish it
      4. On the JSD project, map this new status
      5. Have some issues running through this status so this status is mentioned on the history of the ticket
      6. Go back to the workflow and change the associated workflow to one that does not use this created status (e.g.: associate it with JIRA default workflow)
      7. Delete the status from the system
      8. Go back to customer portal and try to access any page in there
        E.g.: https://YOURINSTANCE.atlassian.net/servicedesk/customer/portals

      Expected Results:
      The customer portal should show up normally.

      Actual Results:
      A stack-trace screen shows up:

      java.lang.NullPointerException at com.atlassian.servicedesk.internal.feature.customer.request.requesttype.RequestStatusMapper.translateToCustomerStatus(RequestStatusService.scala:85) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:146) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:140) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144) at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.extractRelevantChanges(RequestActivityProvider.scala:140) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.com$atlassian$servicedesk$internal$feature$customer$request$RequestActivityProvider$$constructItemBuilder(RequestActivityProvider.scala:161) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:80) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:79) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getStatusList(RequestActivityProvider.scala:79) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getActivity(RequestActivityProvider.scala:133) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemViewCommon(IssueViewProvider.scala:225) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemView(IssueViewProvider.scala:216) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:386) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:379) at scala.Option.map(Option.scala:145) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:379) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:378) at scala.Option.flatMap(Option.scala:170) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper.toRequestListItemViewWithPortal(RequestListProvider.scala:378) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) a

      Workaround:

      1. Search for statuses that have an entry on an issue's history but are not present on the status table. Run:
        select distinct newvalue
        from changeitem 
        where field = 'status' 
          and (newvalue not in (select id from issuestatus))
        UNION 
        select distinct oldvalue
        from changeitem 
        where field = 'status' 
          and (oldvalue not in (select id from issuestatus));

        The query might not be compatible for all databases. Please modify it accordingly

      2. Create a ghost status on the system
      3. Run an update on the database to link the deleted status to this new ghost status
        update issuestatus set id = 'OldID' where id = 'NewID'; --oldID = id found on the previous search newID = id from the new status created
      4. Run a lock-reindex

      If you are using Cloud, raise a ticket with Support Team (support.atlassian.com) so they can apply this workaround.

      Add-on Version:
      JIRA v6.4-OD-16-006
      JIRA Service Desk v2.4

            [JSDSERVER-1773] NPE while accessing Customer Portal when a status has been deleted from workflow

            Owen made changes -
            Workflow Original: JSD Bug Workflow v5 - TEMP [ 2304820 ] New: JAC Bug Workflow v3 [ 3125468 ]
            Status Original: Done [ 10044 ] New: Closed [ 6 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 [ 2058736 ] New: JSD Bug Workflow v5 - TEMP [ 2304820 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 - TEMP [ 2056074 ] New: JSD Bug Workflow v5 [ 2058736 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 [ 1955500 ] New: JSD Bug Workflow v5 - TEMP [ 2056074 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v4 [ 1615266 ] New: JSD Bug Workflow v5 [ 1955500 ]
            jonah (Inactive) made changes -
            Description Original: *Steps to Reproduce:*
            # Have a JSD project
            # Access the customer portal - it should be all ok
            !Screen Shot 2015-04-14 at 5.31.22 PM.png|thumbnail!
            # Add a status on the workflow (e.g.: Atlassian Test Status) > Publish it
            !Screen Shot 2015-04-14 at 5.32.39 PM.png|thumbnail!
            # On the JSD project, map this new status
            !Screen Shot 2015-04-14 at 5.35.23 PM.png|thumbnail!
            # Have some issues running through this status so this status is mentioned on the history of the ticket
            !Screen Shot 2015-04-14 at 5.49.30 PM.png|thumbnail!
            # Go back to the workflow and change the associated workflow to one that does not use this created status (e.g.: associate it with JIRA default workflow)
            # Delete the status from the system
            # Go back to customer portal and try to access any page in there
            E.g.: {{https://YOURINSTANCE.atlassian.net/servicedesk/customer/portals}}

            *Expected Results:*
            The customer portal should show up normally.

            *Actual Results:*
            A stack-trace screen shows up:
            !Screen Shot 2015-04-14 at 5.46.08 PM.png|thumbnail!
            {code:sql}java.lang.NullPointerException at com.atlassian.servicedesk.internal.feature.customer.request.requesttype.RequestStatusMapper.translateToCustomerStatus(RequestStatusService.scala:85) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:146) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:140) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144) at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.extractRelevantChanges(RequestActivityProvider.scala:140) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.com$atlassian$servicedesk$internal$feature$customer$request$RequestActivityProvider$$constructItemBuilder(RequestActivityProvider.scala:161) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:80) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:79) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getStatusList(RequestActivityProvider.scala:79) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getActivity(RequestActivityProvider.scala:133) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemViewCommon(IssueViewProvider.scala:225) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemView(IssueViewProvider.scala:216) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:386) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:379) at scala.Option.map(Option.scala:145) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:379) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:378) at scala.Option.flatMap(Option.scala:170) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper.toRequestListItemViewWithPortal(RequestListProvider.scala:378) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) a{code}

            *Workaround:*
            # Search for statuses that have an entry on an issue's history but are not present on the status table. Run:
            {code:sql}select distinct newvalue
            from changeitem
            where field = 'status'
              and (newvalue not in (select id from issuestatus))
            UNION
            select distinct oldvalue
            from changeitem
            where field = 'status'
              and (oldvalue not in (select id from issuestatus));{code}
            (!) The query might not be compatible for all databases. Please modify it accordingly
            # Create a ghost status on the system
            # Run an update on the database to link the deleted status to this new ghost status
            {code:sql}update issuestatus set id = 'OldID' where id = 'NewID'; --oldID = id found on the previous search newID = id from the new status created{code}
            # Run a lock-reindex

            (i) If you are using Cloud, raise a ticket with Support Team (support.atlassian.com) so they can apply this workaround.

            *Add-on Version:*
            JIRA v6.4-OD-16-006
            JIRA Service Desk v2.4
            New: {panel:bgColor=#e7f4fa}
              *NOTE:* This bug report is for *JIRA Service Desk Server*. Using *JIRA Service Desk Cloud*? [See the corresponding bug report|http://jira.atlassian.com/browse/JSDCLOUD-1773].
              {panel}

            *Steps to Reproduce:*
            # Have a JSD project
            # Access the customer portal - it should be all ok
            !Screen Shot 2015-04-14 at 5.31.22 PM.png|thumbnail!
            # Add a status on the workflow (e.g.: Atlassian Test Status) > Publish it
            !Screen Shot 2015-04-14 at 5.32.39 PM.png|thumbnail!
            # On the JSD project, map this new status
            !Screen Shot 2015-04-14 at 5.35.23 PM.png|thumbnail!
            # Have some issues running through this status so this status is mentioned on the history of the ticket
            !Screen Shot 2015-04-14 at 5.49.30 PM.png|thumbnail!
            # Go back to the workflow and change the associated workflow to one that does not use this created status (e.g.: associate it with JIRA default workflow)
            # Delete the status from the system
            # Go back to customer portal and try to access any page in there
            E.g.: {{https://YOURINSTANCE.atlassian.net/servicedesk/customer/portals}}

            *Expected Results:*
            The customer portal should show up normally.

            *Actual Results:*
            A stack-trace screen shows up:
            !Screen Shot 2015-04-14 at 5.46.08 PM.png|thumbnail!
            {code:sql}java.lang.NullPointerException at com.atlassian.servicedesk.internal.feature.customer.request.requesttype.RequestStatusMapper.translateToCustomerStatus(RequestStatusService.scala:85) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:146) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$7.apply(RequestActivityProvider.scala:140) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144) at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.extractRelevantChanges(RequestActivityProvider.scala:140) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.com$atlassian$servicedesk$internal$feature$customer$request$RequestActivityProvider$$constructItemBuilder(RequestActivityProvider.scala:161) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:80) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider$$anonfun$getStatusList$1.apply(RequestActivityProvider.scala:79) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getStatusList(RequestActivityProvider.scala:79) at com.atlassian.servicedesk.internal.feature.customer.request.RequestActivityProvider.getActivity(RequestActivityProvider.scala:133) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemViewCommon(IssueViewProvider.scala:225) at com.atlassian.servicedesk.internal.feature.customer.request.IssueViewProvider.getIssueListItemView(IssueViewProvider.scala:216) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:386) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1$$anonfun$apply$19.apply(RequestListProvider.scala:379) at scala.Option.map(Option.scala:145) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:379) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper$$anonfun$toRequestListItemViewWithPortal$1.apply(RequestListProvider.scala:378) at scala.Option.flatMap(Option.scala:170) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$IssueToRequestListItemViewMapper.toRequestListItemViewWithPortal(RequestListProvider.scala:378) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at com.atlassian.servicedesk.internal.feature.customer.request.RequestListProvider$$anonfun$10.apply(RequestListProvider.scala:193) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) a{code}

            *Workaround:*
            # Search for statuses that have an entry on an issue's history but are not present on the status table. Run:
            {code:sql}select distinct newvalue
            from changeitem
            where field = 'status'
              and (newvalue not in (select id from issuestatus))
            UNION
            select distinct oldvalue
            from changeitem
            where field = 'status'
              and (oldvalue not in (select id from issuestatus));{code}
            (!) The query might not be compatible for all databases. Please modify it accordingly
            # Create a ghost status on the system
            # Run an update on the database to link the deleted status to this new ghost status
            {code:sql}update issuestatus set id = 'OldID' where id = 'NewID'; --oldID = id found on the previous search newID = id from the new status created{code}
            # Run a lock-reindex

            (i) If you are using Cloud, raise a ticket with Support Team (support.atlassian.com) so they can apply this workaround.

            *Add-on Version:*
            JIRA v6.4-OD-16-006
            JIRA Service Desk v2.4
            jonah (Inactive) made changes -
            Link New: This issue relates to JSDCLOUD-1773 [ JSDCLOUD-1773 ]
            Confluence Escalation Bot (Inactive) made changes -
            Labels New: affects-cloud affects-server
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v2 [ 1602591 ] New: JSD Bug Workflow v4 [ 1615266 ]
            Owen made changes -
            Workflow Original: JSD Bug Workflow [ 1398746 ] New: JSD Bug Workflow v2 [ 1602591 ]

              cnguyen Chuong Nam Nguyen (Inactive)
              ediel Elisa [Atlassian]
              Affected customers:
              2 This affects my team
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: