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

AddedAfterSprintStarts exception with filter subscription

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.3.13
    • Component/s: None
    • Labels:
      None
    • Environment:

      ScriptRunner| 5.2.1 |

      JIRA Software| 7.5.0 |

    • Sprint:
      Sprint 37 - Ends Jan 29
    • Critical Points:
      0.8

      Description

      If you are subscribed to a filter using the ScriptRunner JQL function addedAfterSprintStarts, a NullPointerException will be thrown in the logs when the filter's email notification is sent, regardless if the query returns an issue or not.

      The exception is the following:

      2017-11-09 10:44:00,010 Sending mailitem com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem owner: 'admin(admin)' ERROR anonymous [atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem] 
      java.lang.NullPointerException
      at com.atlassian.greenhopper.web.util.WebUtilities.convertRelativeUrlToAbsolute(WebUtilities.java:259)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueConstantEntry.<init>(RapidIssueConstantEntry.java:18)
      at com.atlassian.greenhopper.web.rapid.list.RapidStatusEntry.<init>(RapidStatusEntry.java:19)
      at com.atlassian.greenhopper.web.rapid.list.RapidStatusEntryCache.newRapidEntry(RapidStatusEntryCache.java:26)
      at com.atlassian.greenhopper.web.rapid.list.RapidStatusEntryCache.newRapidEntry(RapidStatusEntryCache.java:13)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueConstantEntryCache.get(RapidIssueConstantEntryCache.java:41)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryCallback.handleStatus(RapidIssueEntryCallback.java:447)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryCallback.createBaseEntry(RapidIssueEntryCallback.java:272)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryCallback.createVisibleEntry(RapidIssueEntryCallback.java:240)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryCallback.fieldData(RapidIssueEntryCallback.java:213)
      at com.atlassian.greenhopper.service.issue.callback.AbstractCompoundDataCallback.issueComplete(AbstractCompoundDataCallback.java:45)
      at com.atlassian.greenhopper.service.issue.IssueDataCollector.collect(IssueDataCollector.java:83)
      at com.atlassian.greenhopper.service.issue.IssueDataCollector.collect(IssueDataCollector.java:55)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.searchAndSort(LuceneSearchProvider.java:340)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.searchAndSort(LuceneSearchProvider.java:140)
      ... 2 filtered
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      at com.sun.proxy.$Proxy496.searchAndSort(Unknown Source)
      ... 2 filtered
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
      at com.sun.proxy.$Proxy496.searchAndSort(Unknown Source)
      at com.atlassian.greenhopper.service.issue.IssueDataServiceImpl.findImpl(IssueDataServiceImpl.java:156)
      at com.atlassian.greenhopper.service.issue.IssueDataServiceImpl.findAndSortWithServiceOutcome(IssueDataServiceImpl.java:63)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryQueryServiceImpl.collectIssues(RapidIssueEntryQueryServiceImpl.java:767)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryQueryServiceImpl.collectIssues(RapidIssueEntryQueryServiceImpl.java:706)
      at com.atlassian.greenhopper.web.rapid.list.RapidIssueEntryQueryServiceImpl.getIssuesByKeys(RapidIssueEntryQueryServiceImpl.java:585)
      at com.atlassian.greenhopper.web.rapid.chart.HistoricSprintDataFactory.getIssueKeys(HistoricSprintDataFactory.java:163)
      at com.atlassian.greenhopper.web.rapid.chart.HistoricSprintDataFactory.getExpandedSprintContents(HistoricSprintDataFactory.java:130)
      at com.atlassian.greenhopper.web.rapid.chart.HistoricSprintDataFactory.getSprintOriginalContents(HistoricSprintDataFactory.java:89)
      at com.atlassian.greenhopper.web.rapid.chart.HistoricSprintDataFactory$getSprintOriginalContents.call(Unknown Source)
      at com.onresolve.jira.groovy.jql.plugins.AddedRemovedAfterSprintStart$_getQuery_closure1.doCall(AddedRemovedAfterSprintStart.groovy:120)
      ... 2 filtered
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
      at groovy.lang.Closure.call(Closure.java:426)
      at groovy.lang.Closure.call(Closure.java:442)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
      at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at com.onresolve.jira.groovy.jql.plugins.AddedRemovedAfterSprintStart.getQuery(AddedRemovedAfterSprintStart.groovy:119)
      at com.onresolve.jira.groovy.jql.plugins.AddedRemovedAfterSprintStart$getQuery.call(Unknown Source)
      at com.onresolve.jira.groovy.jql.ScriptedJqlFunction.getQuery(ScriptedJqlFunction.groovy:117)
      at com.onresolve.jira.groovy.jql.ScriptedJqlFunction$getQuery.call(Unknown Source)
      at com.onresolve.jira.groovy.jql.ScriptedFunctionClauseFactory.getQuery(ScriptedFunctionClauseFactory.groovy:92)
      at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:97)
      at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:25)
      at com.atlassian.query.clause.TerminalClauseImpl.accept(TerminalClauseImpl.java:143)
      at com.atlassian.jira.jql.query.QueryVisitor.createQuery(QueryVisitor.java:51)
      at com.atlassian.jira.jql.query.DefaultLuceneQueryBuilder.createLuceneQuery(DefaultLuceneQueryBuilder.java:29)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.createLuceneQuery(LuceneSearchProvider.java:263)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:206)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:297)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:109)
      at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:105)
      at com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem.getContextParams(SubscriptionSingleRecepientMailQueueItem.java:243)
      at com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem.sendSearchRequestEmail(SubscriptionSingleRecepientMailQueueItem.java:119)
      at com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem.send(SubscriptionSingleRecepientMailQueueItem.java:104)
      at com.atlassian.mail.queue.MailQueueImpl.sendBufferUnderLock(MailQueueImpl.java:103)
      at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:56)
      at com.atlassian.jira.mail.JiraMailQueue$1.apply(JiraMailQueue.java:51)
      at com.atlassian.jira.mail.JiraMailQueue$1.apply(JiraMailQueue.java:48)
      at com.atlassian.jira.util.velocity.DefaultVelocityRequestContextFactory.runWithStaticBaseUrl(DefaultVelocityRequestContextFactory.java:110)
      at com.atlassian.jira.util.DefaultBaseUrl.runWithStaticBaseUrl(DefaultBaseUrl.java:50)
      at com.atlassian.jira.mail.JiraMailQueue.sendBuffer(JiraMailQueue.java:48)
      at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:21)
      at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)
      at com.atlassian.jira.service.ServiceRunner.runService(ServiceRunner.java:62)
      at com.atlassian.jira.service.ServiceRunner.runServiceId(ServiceRunner.java:44)
      at com.atlassian.jira.service.ServiceRunner.runJob(ServiceRunner.java:32)
      at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:153)
      at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:118)
      at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:97)
      at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:443)
      at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(CaesiumSchedulerService.java:410)
      at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:388)
      at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:285)
      at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:282)
      at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:65)
      at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:59)
      at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:34)
      at java.lang.Thread.run(Thread.java:745)

      Steps to Reproduce:

      • Create a new Scrum Board and name it something simple like "XYZ"
      • Create a new JQL filter with the JQL:
        issueFunction in addedAfterSprintStart(XYZ)
      • After saving the filter, click he link labeled "Details" to the left of the star and to the right of the filter title: 
      • Then set up a new subscription that executes every minute. You can use the CRON statement: 0 0/1 * 1/1 * ? *
        • Make sure to check the box that says "Email this filter, even if there are no issues found"
      • With the subscription set up, start a new sprint and watch the errors roll in every minute!

        Attachments

          Activity

            People

            Assignee:
            ahasan Ashraful Hasan [X] (Inactive)
            Reporter:
            aderossett Aidan Derossett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: