Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events