CyphoServerityChange

python · Cypho Threat Intelligence

Source

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

incident = demisto.incident() or {}
custom_fields = incident.get("CustomFields") or {}

cypho_severity = custom_fields.get("cyphorisklevel")
cypho_ticket_id = custom_fields.get("cyphoticketid")
owner = incident.get("owner")

if not cypho_ticket_id:
    raise DemistoException("Cypho ticket ID not found in incident fields.")

if not owner:
    raise DemistoException("Incident has no assigned owner.")

res = demisto.executeCommand("getUsers", {})
if isError(res[0]):
    raise DemistoException(f"Failed to retrieve users: {get_error(res)}")

all_users = res[0].get("Contents", [])
matched_user = next((u for u in all_users if u.get("username") == owner), None)

if not matched_user:
    raise DemistoException(f"Owner '{owner}' not found among XSOAR users.")

email = matched_user.get("email")
if not email:
    raise DemistoException(f"User '{owner}' has no email address configured.")

args = {"ticket_id": cypho_ticket_id, "user_email": email, "severity": cypho_severity}

demisto.executeCommand("cypho-update-severity", args)
demisto.results(f"Cypho ticket {cypho_ticket_id} severity updated to {cypho_severity} by {email}.")

README

Cypho Severity Change

This automation is triggered when the severity field of a Cypho-related incident is updated in Cortex XSOAR.

The script synchronizes the updated severity value with the corresponding issue in Cypho, ensuring that both platforms remain consistent. This allows analysts to manage incident severity directly from XSOAR without performing manual updates in Cypho.

The automation is designed to work as a field-change-triggered script and is typically attached to the Cypho Severity incident field. It validates that the incident is properly assigned before executing the update, ensuring accountability and accurate analyst activity tracking.

Script Data


Name Description
Script Type python3
Tags field-change-triggered

Inputs


There are no inputs for this script.
The automation automatically uses the updated incident severity field and the associated Cypho ticket metadata.

Outputs


There are no outputs for this script.
The script performs a background synchronization with Cypho and updates the external issue severity accordingly.

✔ Notes

  • This script is intended to run automatically and should not be executed manually.
  • The incident must be assigned before the severity change is synchronized.
  • Designed for seamless integration with Cypho and Cortex XSOAR incident workflows.