SetTime

Fill the current time in a custom incident field.

python · Common Scripts

Details

IDSetTime
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10404775

README

Fills the current time in a custom incident field.

Script Data


Name Description
Script Type python
Tags -

Inputs


Argument Name Description
fieldName The incident field name to set.

Outputs


There are no outputs for this script.

import demistomock as demisto


def test_set_time(mocker):
    """
    Given:
        - The script args.

    When:
        - Running the set_time function.

    Then:
        - Validating the outputs as expected.
    """
    from SetTime import set_time

    mocker.patch.object(demisto, "args", return_value={"fieldName": "field"})
    mocker.patch.object(demisto, "setContext")
    execute_mock = mocker.patch.object(demisto, "executeCommand")
    mocker.patch.object(demisto, "results")
    set_time()
    assert execute_mock.call_count == 1