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

    XMLWordPrintable

Details

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              cnguyen Chuong Nam Nguyen (Inactive)
              ediel Elisa [Atlassian]
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync