Hi,
I was testing a custom listener in Script Runner and I used some code that I found :
https://scriptrunner.adaptavist.com/latest/jira/listeners.html
(in the JIRA Software Events section)
Here it is :
import com.atlassian.greenhopper.service.rapid.view.RapidViewService import com.atlassian.greenhopper.service.sprint.Sprint import com.atlassian.greenhopper.web.rapid.chart.HistoricSprintDataFactory import com.atlassian.jira.component.ComponentAccessor import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser import com.onresolve.scriptrunner.runner.customisers.WithPlugin @WithPlugin("com.pyxis.greenhopper.jira") def historicSprintDataFactory = PluginModuleCompilationCustomiser.getGreenHopperBean(HistoricSprintDataFactory) def rapidViewService = PluginModuleCompilationCustomiser.getGreenHopperBean(RapidViewService) def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser() def sprint = event.sprint as Sprint if (sprint.state == Sprint.State.CLOSED) { def view = rapidViewService.getRapidView(user, sprint.rapidViewId).value def sprintContents = historicSprintDataFactory.getSprintOriginalContents(user, view, sprint) def sprintData = sprintContents.value if (sprintData) { def incompleteIssues = sprintData.contents.issuesNotCompletedInCurrentSprint*.issueId log.warn "incompelte issues id : ${incompleteIssues}" } }
And leaving the code exactly like in the documentation, I get the following error :
Does anyone know how to solve this issue?
Thanks
Running the script works even if there is an error in edit mode.
@JT try this:
def event = event as com.atlassian.greenhopper.api.events.sprint.SprintEvent
def sprint = event.sprint as Sprint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.