Hello,
I want to gather a list of sprints using SprintManager and SprintManagerImpl.
This is what I have tried but it crashes.
public class GetSprintsForUI implements ValuesGenerator {
@Override
public Map getValues(Map map) {
SprintManager spm = new SprintManagerImpl();
Map<String, String> sprintsMap = new HashMap<String, String>();
ServiceOutcome<Collection<Sprint>> serviceOutcome = spm.getAllSprints();
if(serviceOutcome==null){
return null;
}
for(Sprint s : serviceOutcome.getValue()){
sprintsMap.put(String.valueOf(s.getId()),s.getName());
}
return sprintsMap;
}
}
This is the error I get:
Caused by: java.lang.NullPointerException
at com.atlassian.greenhopper.service.sprint.SprintManagerImpl.getAllSprints(SprintManagerImpl.java:123) [?:?]
at com.jiraPlugin.utility.GetSprintsForUI.getValues(GetSprintsForUI.java:47) [?:?]
at com.atlassian.configurable.ValuesGeneratorObjectConfigurationProperty.getInternalValues(ValuesGeneratorObjectConfigurationProperty.java:75) [classes/:?]
at com.atlassian.configurable.ObjectConfigurationPropertyImpl.entrySet(ObjectConfigurationPropertyImpl.java:266) [classes/:?]
at com.atlassian.jira.plugin.corereports.web.action.ConfigureReport.mapAndConvertToList(ConfigureReport.java:383) [?:?]
at com.atlassian.jira.plugin.corereports.web.action.ConfigureReport.access$000(ConfigureReport.java:53) [?:?]
at com.atlassian.jira.plugin.corereports.web.action.ConfigureReport$ObjectConfigurationField.getValues(ConfigureReport.java:440) [?:?]
... 387 more
Does anyone knows what am I doing wrong?
Thank you.