I'm attempting to use a ScriptRunner/Groovy script to give me a list of active and open (in progress & future) sprints in a specific board. For some reason, whenever I use the getSprintsForView() method, it fails and errors "cannot invoke method getSprintsForView() on null object".
The odd thing is that I check if the view is null, and the view seems to work just fine with other methods (like getOpenSprintsAndBacklogProjects.
def sprintManager = ComponentAccessor.getOSGiComponentInstanceOfType(SprintManager.class);
def rapidViewService = ComponentAccessor.getOSGiComponentInstanceOfType(RapidViewService.class);
def rapidViewQueryService = ComponentAccessor.getOSGiComponentInstanceOfType(RapidViewQueryService.class);
board_id = 89L;
def sprints = ;
def sprints_two = ;
def view = rapidViewService.getRapidView(user, board_id).getValue();
if (view != null)
sprints = rapidViewQueryService.getOpenSprintsAndBacklogProjects(user, view).getValue().left();
sprints_two = sprintManager.getSprintsForView(view).getValue();
What am I doing wrong?
What if you try to get the sprintManager like
SprintManager sprintManager = PluginModuleCompilationCustomiser.getGreenHopperBean(SprintManager)
Please let me know if this does the trick.
We're excited to announce the release of a long-requested feature on Statuspage. Now visitors to your status page can subscribe to get notified in Slack when you report an incident or maintenance. Th...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events