class ComplianceRepositoryImpl implements ComplianceRepository, Constants {

    @SuppressWarnings("rawtypes")
    public Map<String, Object> getPolicyViolationDetailsByIssueId(String assetGroup, String issueId)
            throws DataException {
    	Map<String, Object> issueDetails = new HashMap<>();
		StringBuilder urlToQuery = new StringBuilder(esUrl).append("/").append(assetGroup);
		urlToQuery.append("/").append(SEARCH);

		StringBuilder requestBody = new StringBuilder();
		requestBody.append("{\"query\":{\"bool\":{\"must\":[{\"match\":{\"type\":\"issue\"}},{\"match\":{\"_id\":\"")
				.append(issueId).append("\"}}]}}}");
        String responseJson = "";
        try {
            responseJson = PacHttpUtils.doHttpPost(urlToQuery.toString(), requestBody.toString());
        } catch (Exception e) {
            logger.error(e.getMessage());
            throw new DataException("No response found!!" + e);
        }
        JsonParser jsonParser = new JsonParser();
        JsonObject resultJson = (JsonObject) jsonParser.parse(responseJson);

        if (resultJson != null) {
            JsonObject hitsJson = (JsonObject) jsonParser.parse(resultJson.get(HITS).toString());
            JsonArray hitsArray = hitsJson.getAsJsonArray(HITS);
            for (int i = 0; i < hitsArray.size(); i++) {
                JsonObject source = hitsArray.get(i).getAsJsonObject().get("_source").getAsJsonObject();
                issueDetails.put(RULEID, source.get(RULEID).getAsString());
                issueDetails.put(RESOURCEID, source.get(RESOURCEID).getAsString());
                issueDetails.put(TARGET_TYPE, source.get(TARGET_TYPE).getAsString());
                issueDetails.put(ISSUE_STATUS, source.get(ISSUE_STATUS).getAsString());
                issueDetails.put(RULE_CATEGORY, source.get(RULE_CATEGORY).getAsString());
                issueDetails.put(SEVERITY, source.get(SEVERITY).getAsString());
                issueDetails.put(POLICYID, source.get(POLICYID).getAsString());
                issueDetails.put(CREATED_DATE, source.get(CREATED_DATE).getAsString());
                issueDetails.put(MODIFIED_DATE, source.get(MODIFIED_DATE).getAsString());
                if(source.has("desc")){
                    issueDetails.put(ISSUE_REASON, source.get("desc").getAsString());
                   }else{
                       JsonObject message = (JsonObject) jsonParser.parse(source.get("message").getAsString());
                       issueDetails.put(ISSUE_REASON, message.get("desc").getAsString());
                   }
                if (null != source.get(ISSUE_DETAILS)) {
                    issueDetails.put(ISSUE_DETAILS, source.get(ISSUE_DETAILS).getAsString());
                }
            }
        }
        return issueDetails;
    }

}