import traceback import demistomock as demisto from CommonServerPython import * def get_html_representation(entity: str, is_isolated: str) -> str: if not entity: html = "

No IP Address associated with the ChronicleAsset

" else: html = f"

{entity}
IP Address Not Isolated

" if is_isolated == "Yes": html = f"

{entity}
IP Address Isolated

" return html def main() -> None: try: indicator_custom_fields = demisto.args().get("indicator").get("CustomFields", {}) entity = indicator_custom_fields.get("chronicleassetip", "") is_isolated = indicator_custom_fields.get("chronicleisolatedip", "No") html = get_html_representation(entity, is_isolated) demisto.results({"Type": 1, "ContentsFormat": formats["html"], "Contents": html}) except Exception as e: demisto.error(traceback.format_exc()) return_error(f"Could not load widget:\n{e}") # python2 uses __builtin__ python3 uses builtins if __name__ == "__builtin__" or __name__ == "builtins": main()