diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java index 5c0537d2d3d..f1783cb619d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java @@ -40,8 +40,12 @@ public class GroupManagementAdminServiceImpl implements GroupManagementAdminServ try { RequestValidationUtil.validatePaginationParameters(offset, limit); GroupPaginationRequest request = new GroupPaginationRequest(offset, limit); - request.setGroupName(name.toUpperCase()); - request.setOwner(owner.toUpperCase()); + if (name != null){ + request.setGroupName(name.toUpperCase()); + } + if (owner != null) { + request.setOwner(owner.toUpperCase()); + } PaginationResult deviceGroupsResult = DeviceMgtAPIUtils.getGroupManagementProviderService() .getGroups(request); DeviceGroupList deviceGroupList = new DeviceGroupList();