diff --git a/src/main/java/edu/tamu/app/cache/service/ActiveSprintsScheduledCacheService.java b/src/main/java/edu/tamu/app/cache/service/ActiveSprintsScheduledCacheService.java index 3936f2a0..cd8a566d 100644 --- a/src/main/java/edu/tamu/app/cache/service/ActiveSprintsScheduledCacheService.java +++ b/src/main/java/edu/tamu/app/cache/service/ActiveSprintsScheduledCacheService.java @@ -91,7 +91,7 @@ private List fetchActiveSprints(Product product) { remoteProductInfo.get().forEach(rp -> { RemoteProductManagerBean remoteProductManagerBean = (RemoteProductManagerBean) managementBeanRegistry.getService(rp.getRemoteProductManager().getName()); try { - activeSprints.addAll(remoteProductManagerBean.getActiveSprintsByProductIdAndName(rp.getScopeId(), product.getName())); + activeSprints.addAll(remoteProductManagerBean.getActiveSprintsByProductId(rp.getScopeId())); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/edu/tamu/app/service/manager/GitHubService.java b/src/main/java/edu/tamu/app/service/manager/GitHubService.java index b951fd71..a2459927 100644 --- a/src/main/java/edu/tamu/app/service/manager/GitHubService.java +++ b/src/main/java/edu/tamu/app/service/manager/GitHubService.java @@ -93,7 +93,7 @@ public RemoteProduct getRemoteProductByScopeId(final String scopeId) throws Exce } @Override - public List getActiveSprintsByProductIdAndName(final String productScopeId, final String productName) throws Exception { + public List getActiveSprintsByProductId(final String productScopeId) throws Exception { logger.info("Fetching active sprints for product with scope id " + productScopeId); List activeSprints = new ArrayList(); GHRepository repo = github.getRepositoryById(productScopeId); @@ -101,8 +101,9 @@ public List getActiveSprintsByProductIdAndName(final String productScope for (GHProject project : projects) { String sprintId = String.valueOf(project.getId()); String name = project.getName(); + String projectName = repo.getName(); List cards = getCards(project); - activeSprints.add(new Sprint(sprintId, name, productName, cards)); + activeSprints.add(new Sprint(sprintId, name, projectName, cards)); } return activeSprints; } diff --git a/src/main/java/edu/tamu/app/service/manager/RemoteProductManagerBean.java b/src/main/java/edu/tamu/app/service/manager/RemoteProductManagerBean.java index 85989976..5fef3e80 100644 --- a/src/main/java/edu/tamu/app/service/manager/RemoteProductManagerBean.java +++ b/src/main/java/edu/tamu/app/service/manager/RemoteProductManagerBean.java @@ -13,7 +13,7 @@ public interface RemoteProductManagerBean extends ManagementBean { public RemoteProduct getRemoteProductByScopeId(final String scopeId) throws Exception; - public List getActiveSprintsByProductIdAndName(final String productScopeId, final String productName) throws Exception; + public List getActiveSprintsByProductId(final String productScopeId) throws Exception; public List getAdditionalActiveSprints() throws Exception; diff --git a/src/main/java/edu/tamu/app/service/manager/VersionOneService.java b/src/main/java/edu/tamu/app/service/manager/VersionOneService.java index 7df3f1aa..c8bc52fa 100644 --- a/src/main/java/edu/tamu/app/service/manager/VersionOneService.java +++ b/src/main/java/edu/tamu/app/service/manager/VersionOneService.java @@ -126,7 +126,7 @@ public int getPrimaryWorkItemCount(final String type, final String scopeId) thro } @Override - public List getActiveSprintsByProductIdAndName(final String productScopeId, final String productName) throws ConnectionException, APIException, OidException, IOException { + public List getActiveSprintsByProductId(final String productScopeId) throws ConnectionException, APIException, OidException, IOException { logger.info("Fetching active sprints for product with scope id " + productScopeId); List activeSprints = new ArrayList(); IAssetType timeboxType = services.getMeta().getAssetType("Timebox"); @@ -156,6 +156,17 @@ public List getActiveSprintsByProductIdAndName(final String productScope String id = parseId(sprint.getOid()); String name = sprint.getAttribute(nameAttributeDefinition).getValue().toString(); + Object[] scheduledScopes = sprint.getAttribute(scheduleScheduledScopesAttributeDefinition).getValues(); + Object[] scheduledScopeNames = sprint.getAttribute(scheduleScheduledScopesNameAttributeDefinition).getValues(); + + String productName = null; + for (int i = 0; i < scheduledScopes.length; i++) { + if (scheduledScopes[i].toString().equals("Scope:" + productScopeId)) { + productName = scheduledScopeNames[i].toString(); + break; + } + } + List cards = getActiveSprintsCards(id); activeSprints.add(new Sprint(id, name, productName, cards)); }