IncidentsCheck-NumberofIncidentsNoOwner

Health Check dynamic section, showing the number of unassigned incidents.

python · Integrations & Incidents Health Check

Details

IDIncidentsCheck-NumberofIncidentsNoOwner
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-section failedIncidents

README

Health Check dynamic section, showing the number of unassigned incidents.

Script Data


Name Description
Script Type python3
Tags dynamic-section, failedIncidents
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401

RED_HTML_STYLE = "color:#FF1744;text-align:center;font-size:800%;>"
GREEN_HTML_STYLE = "color:#00CD33;text-align:center;font-size:800%;>"


def main():
    incident = demisto.incidents()
    query = incident[0].get("CustomFields", {}).get("unassignedincidents")

    if not query:
        html = f"<h1 style={GREEN_HTML_STYLE}0</h1>"

    else:
        incident_ids = set(query)
        html = f"<h1 style={RED_HTML_STYLE}{len(incident_ids)}</h1>"

    demisto.results({"ContentsFormat": formats["html"], "Type": entryTypes["note"], "Contents": html})


if __name__ in ["__main__", "builtin", "builtins"]:
    main()