diff --git a/src/main/java/org/sunbird/assessment/service/CohortsServiceImpl.java b/src/main/java/org/sunbird/assessment/service/CohortsServiceImpl.java index fbb0a5c96..9ef144807 100644 --- a/src/main/java/org/sunbird/assessment/service/CohortsServiceImpl.java +++ b/src/main/java/org/sunbird/assessment/service/CohortsServiceImpl.java @@ -140,10 +140,14 @@ public List getActiveUsers(String xAuthUser, String rootOrg, String // if (!userUtilService.validateUser(rootOrg, userId)) { // throw new BadRequestException("Invalid UserId."); // } - - List batchIdList = fetchBatchIdDetails(contentId); - if (CollectionUtils.isEmpty(batchIdList)) { - return Collections.emptyList(); + List batchIdList = null; + List batches = fetchBatchDetails(contentId); + if (!CollectionUtils.isEmpty(batches)) { + batchIdList = batches.stream().map(SunbirdApiBatchResp::getBatchId).collect(Collectors.toList()); + //List batchIdList = fetchBatchIdDetails(contentId); + if (CollectionUtils.isEmpty(batchIdList)) { + return Collections.emptyList(); + } } return fetchParticipantsList(xAuthUser, rootOrg, batchIdList, count); }