try {
ServiceOutcome<Sprint> sprintToDelete = getSprintManager().getSprint(sprint.getId());
sprintDelete = (Sprint) sprintToDelete.getValue();
}
catch (InvalidSyntaxException e)
{
System.out.println("Got an SearchException: " + e.getCause());
}
try {
this.deleteSprint(sprintDelete);
}
catch (InvalidSyntaxException e)
{
System.out.println("Got an SearchException: " + e.getCause());
}
void deleteSprint(final Sprint sprint) throws InvalidSyntaxException {
final ServiceOutcome<Void> delete = getSprintManager().deleteSprint(sprint);
}
Here is context:
private SprintHelper getSprintHelper() throws InvalidSyntaxException {
ApplicationContext appCtx = (ApplicationContext) getGreenHopperAppCtx();
if (appCtx != null) {
return (SprintHelper) appCtx.getBean("sprintHelper");
}
return null;
}
private SprintManager getSprintManager() throws InvalidSyntaxException {
ApplicationContext appCtx = (ApplicationContext) getGreenHopperAppCtx();
if (appCtx != null) {
return (SprintManager) appCtx.getBean("sprintManagerImpl");
}
return null;
}
private SprintService getSprintService() throws InvalidSyntaxException {
ApplicationContext appCtx = (ApplicationContext) getGreenHopperAppCtx();
if (appCtx != null) {
return (SprintService) appCtx.getBean("sprintServiceImpl");
}
return null;
}
private JqlHelper getJqlHelper() throws InvalidSyntaxException {
ApplicationContext appCtx = (ApplicationContext) getGreenHopperAppCtx();
if (appCtx != null) {
return (JqlHelper) appCtx.getBean("jqlHelper");
}
return null;
}
private Object getGreenHopperAppCtx() throws InvalidSyntaxException {
OsgiContainerManager osgi = ComponentAccessor.getComponentOfType(OsgiContainerManager.class);
if (osgi == null) {
java.lang.System.out.println("OSGI Not Found");
return null;
}
Bundle[] bundles = osgi.getBundles();
for (int i = 0; i < bundles.length; i++) {
Bundle bundle = bundles[i];
if ("com.pyxis.greenhopper.jira".equals(bundle.getSymbolicName())) {
BundleContext bctx = bundle.getBundleContext();
ServiceReference[] refs = bctx.getAllServiceReferences(null, null);
if (refs != null) {
for (int j = 0; j < refs.length; j++) {
Object prop = refs[j].getProperty("org.springframework.context.service.name");
if ("com.pyxis.greenhopper.jira".equals(prop)) {
return bctx.getService(refs[j]);
}
}
}
}
}
return null;
}
And here is a error:
2020-10-30 05:43:37,867+0000 http-nio-8080-exec-5 ERROR [c.a.j.web.servlet.InternalServerErrorServlet] {errorId=aa2b6339-63cf-419b-833b-4257154a962a, interpretedMsg=, cause=java.lang.NoSuchMethodError: com.atlassian.greenhopper.service.sprint.SprintManager.deleteSprint(Lcom/atlassian/greenhopper/service/sprint/Sprint;)Lcom/atlassian/greenhopper/service/ServiceOutcome;,
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
, referer=https://jira.i4ware.fi/secure/SprintsDashboard.jspa, servletErrorMessage=}