Gmp.get_reports Null Severity and Status

the get_reports method retrieves and processes scan reports. One key challenge faced is handling null values for severity and status. When parsing report data, the method iterates through each report entry, extracting details like the creation date, status, and severity. However, in some cases, the severity and status fields may be null or empty, leading to inconsistencies in the report data

    def get_reports(self):
        try:
            with Gmp(connection=self.connection, transform=self.transform) as gmp:
                gmp.authenticate('admin', 'admin')
                reports_response = gmp.get_reports(details=True)  # Use details=True to get additional details
                reports = []
                for report in reports_response.xpath('report'):
                    report_dict = {
                        'date': report.findtext('creation_time'),
                        'status': report.findtext('report/status'),
                        'name': report.findtext('task/name'),  
                        'severity': report.findtext('report/severity')
                    }
                    reports.append(report_dict)
                return reports
        except GvmError as e:
            return f"An error occurred: {e}"

```can anyone help me please

Hi, sorry but I don’t understand what you are asking for exactly. Did you take a look at the specific reports which don’t return a severity and status for example in the web UI?

I have integrated green bone in my python project I used gmp in the service I have a method get_reports when I call the API view it fetches only the date and task name but the status and the severity he get them both null I think the problem in the xml path can you help me to find another solution to get all the reports and results too . Help me please

I fixed it