diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java index 99e0bd0c3ee..7bc831c3137 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java @@ -99,8 +99,7 @@ public class DeviceStatusMonitoringTask extends DynamicPartitionedScheduleTask { long lastUpdatedTime = (timeMillis - monitoringData .getLastUpdatedTime()) / 1000; - EnrolmentInfo enrolmentInfo = new EnrolmentInfo(); - enrolmentInfo.setId(monitoringData.getDevice().getEnrolmentInfo().getId()); + EnrolmentInfo enrolmentInfo = monitoringData.getDevice().getEnrolmentInfo(); EnrolmentInfo.Status status = null; if (lastUpdatedTime >= this.deviceStatusTaskPluginConfig .getIdleTimeToMarkInactive()) {