How to Set sprint Defaults

Cynthia November 7, 2019

When creating an issue, I want the sprint value to be entered as the default value.

Is there a way to set the default sprint values via behaviors or scriptRunner?
If so, what code should I use?

 

import com.atlassian.greenhopper.service.sprint.SprintManager
import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

@WithPlugin("com.pyxis.greenhopper.jira")
def sprintManager = PluginModuleCompilationCustomiser.getGreenHopperBean(SprintManager)

def sprintServiceOutcome = sprintManager.getAllSprints()

if (sprintServiceOutcome?.valid) {
def sprint = sprintServiceOutcome.getValue().find {it.name == "Ongoing"}
if (!sprint) {
log.debug "Could not find sprint with name <SPrint 1>"
} else {
// do something with this sprint
}
}

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events