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.
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.