Forums

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

How i can get closed sprint?

Ruslan July 25, 2022

Hi. I use scriptrunner and i need creatre report. 

I need get closed sprints this month for certain projects/boards. 

How i can get? 

I tryed used example 

def SprintService = getComponent(SprintService)

 but error 

groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getComponent() is applicable for argument types: (Class) values: [interface com.atlassian.greenhopper.service.sprint.SprintService] at Script390.run(Script390.groovy:4)

 

next im try use 

def jiraUser =ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
SprintService.getSprint(jiraBotUser,13860)

but error 

groovy.lang.MissingMethodException: No signature of method: static com.atlassian.greenhopper.service.sprint.SprintService.getSprint() is applicable for argument types: (com.atlassian.jira.user.DelegatingApplicationUser, Integer) values: [Ruslan(JIRAUSER19132), 13860] Possible solutions: toString(), toString() at Script426.run(Script426.groovy:8)

pls help

 

2 answers

1 accepted

0 votes
Answer accepted
Ruslan August 3, 2022

This work for me 

@JiraAgileBean
RapidViewService rapidViewService
@JiraAgileBean
SprintManager sprintManager
def view = rapidViewService.getRapidView(user, key).getValue()
    def sprintsofMounth = sprintManager.getSprintsForView(view).getValue().findAll { }
0 votes
Craig Nodwell
Community Champion
July 26, 2022

Hi @Руслан welcome to the community.  Can you share your script for review, knowing what you've done will help to resolve the issues that you are experiencing.

Ruslan July 27, 2022

Hi, Craig. Thanks. 

I can't share you scrpit, cuz i cant started scrpit. I want to calculate %% of tasks completed in sprint ( planned in sprint vs de facto completed ) , thats why i tryid to get SprintService to ge list of sprints. but I always get only error. 

How i can use SprintService correctly and wil get sprint or list sprints. 

Suggest an answer

Log in or Sign up to answer