StopTimeToAssignOnOwnerChange

Stops the "Time To Assign" timer if the owner of the incident was changed.

python · Common Scripts

Source

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

# ##### Help #####
# This is an example script. The script is used to stop the Time to Assignment SLA field,
# once an owner was set to an incident. If you want to use this script, you should go to
# the Owner field, and set this script as the script to run upon change of field value.


def main():
    args = demisto.args()
    try:
        if not args.get("old") and args.get("new"):  # If owner was no-one and is now someone:
            demisto.executeCommand("stopTimer", {"timerField": "timetoassignment"})
            demisto.results("Assignment of the incident was successful and so the Time To Assignment timer has been stopped.")
    except Exception as e:  # pragma: no cover
        err_msg = f"Encountered an error while running the script: [{e}]"
        return_error(err_msg, error=e)


if __name__ in ("__main__", "__builtin__", "builtins"):
    main()

README

Stops the “Time To Assign” timer if the owner of the incident was changed.

Script Data


Name Description
Script Type python2
Tags field-change-triggered, example
Cortex XSOAR Version 5.0.0

Inputs


Argument Name Description
old The old value of the changed field
new The new value of the changed field

Outputs


There are no outputs for this script.