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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.