I am attempting to get a list of all sprints that belong to a particular board in a ScriptRunner script. I have been able to use the ProjectManager in the following manner:
'''
Hi @BSCI-SCMNM8-SVC I dont use sprint manager, but the idea is get them from the tickets with JQL filter
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.fields.CustomFieldimport com.atlassian.greenhopper.service.sprint.SprintCustomField sprint = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10608")List<Sprint>results = []Issues.search('project = ITSMP and Sprint in openSprints()').each { issue -> List<Sprint> sprints = (List<Sprint>)issue.getCustomFieldValue(sprint) results.addAll(sprints)} results.unique().each { s -> log.warn(s.getName() + " Active -> " + s.getState().toString()) }
Results I got:2023-07-27 03:41:27,060 WARN [runner.ScriptBindingsManager]: CW 27/2023 -> ACTIVE2023-07-27 03:41:27,060 WARN [runner.ScriptBindingsManager]: CW 21/2023 -> CLOSED2023-07-27 03:41:27,060 WARN [runner.ScriptBindingsManager]: CW 25/2023 -> CLOSED
In the results it also includes closed sprints cause some ticket has invoked in many sprint and not finish yet.Hope it helps!
It looks like you're new here. Sign in or register to get started.