Hello.
My task is to fill Sprint field = current active sprint by default.
I've written this code as my first behaviour script
import com.atlassian.greenhopper.service.sprint.Sprint
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def sprintManager = PluginModuleCompilationCustomiser.getGreenHopperBean(SprintManager)
def sprintServiceOutcome = sprintManager.getAllSprints()
def SprintField = getFieldByName("Sprint")
SprintField.setFormValue(sprintServiceOutcome.getValue()[0])
Here I'm going to get all sprints, filter them in some way (by state and rapidboard - not implemented yet) and set it to Sprint field.
But this code do not work for me. I've tried to debug and I'm sure that
sprintServiceOutcome.getValue()[0]
have not null value and fieldname is correct, so,
SprintField
also is not null.
So I don't know how to do it using adaptavist Scriptrunner.
P.S: maybe there is a way to resolve this better. Appreciate any improvements.
It looks like this is not yet supported.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.