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

Filters that reference sprint IDs return 500 when that sprint is deleted

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. Create a sprint.
      2. Create a JIRA filter using the Basic Search (choose More > Sprint and tick the new sprint).
      3. Delete that newly-created sprint
      4. While being on the rapid board, reload the filter in the Issue Navigator from Issue -> <filter-name>

      Expected results

      The filter loads but with a message saying that that sprint doesn't exist.

      Actual results

      The filter blows up with a 500 error, and this stack trace:

      com.atlassian.jira.issue.customfields.impl.FieldValidationException: Sprint must exist: 11
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getSingularObjectFromString(SprintCFType.java:152)
      	at com.atlassian.greenhopper.customfield.sprint.SprintCFType.getSingularObjectFromString(SprintCFType.java:68)
      	at com.atlassian.greenhopper.customfield.sprint.SprintSearchRenderer.getSprintFromIdObj(SprintSearchRenderer.java:109)
      	at com.atlassian.greenhopper.customfield.sprint.SprintSearchRenderer.access$200(SprintSearchRenderer.java:30)
      	at com.atlassian.greenhopper.customfield.sprint.SprintSearchRenderer$2.apply(SprintSearchRenderer.java:154)
      	at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451)
      	at java.util.AbstractList$Itr.next(AbstractList.java:358)
      	at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
      	at java.util.HashSet.<init>(HashSet.java:119)
      	at com.google.common.collect.Sets.newHashSet(Sets.java:211)
      	at com.atlassian.greenhopper.customfield.sprint.SprintSearchRenderer.getViewHtml(SprintSearchRenderer.java:82)
      	at com.atlassian.jira.components.query.DefaultSearcherService.getValueResults(DefaultSearcherService.java:251)
      	at com.atlassian.jira.components.query.DefaultSearcherService.getSearchResults(DefaultSearcherService.java:180)
      	at com.atlassian.jira.components.query.DefaultSearcherService.searchWithJql(DefaultSearcherService.java:174)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy4496.searchWithJql(Unknown Source)
      	at com.atlassian.jira.plugin.issuenav.IssueNavAction.performSearch(IssueNavAction.java:1235)
      	at com.atlassian.jira.plugin.issuenav.IssueNavAction.doNav(IssueNavAction.java:414)
      	at com.atlassian.jira.plugin.issuenav.IssueNavAction.doDefault(IssueNavAction.java:258)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
      	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
      [...]
      

      Workaround

      The filter will either need to be manually updated in the database, or a new filter created with the same details but without the reference to the deleted sprint ID and the board swapped over to use that.

      The Basic Search in the issue navigator uses sprint IDs instead of the names when it saves the filter. Using advanced search and using "sprint = <name of sprint>" when creating the filter doesn't have this problem.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nmason Nick Mason
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: