{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":3848,"path":"build-workflows/system-events/r_ScriptActions.md","title":"Script actions","bundle":null,"doc_type":null,"release":"australia","body":"\n# Script actions\n\nYou can use script actions to create server-side scripts that perform a variety of tasks, such as modifying a configuration item \\(CI\\), or managing failed login attempts. Script actions are triggered by events only.\n\nRole required: sysevent\\_script\\_action\\_admin or admin\n\nTo create a new script action, navigate to **System Policy** &gt; **Events** &gt; **Script Actions** and click **New**.\n\n<table id=\"table_xc1_q3p_22c\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nUnique name for your script action.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nApplication that contains the script.\n\n</td></tr><tr><td>\n\nEvent name\n\n</td><td>\n\nEvent to use for this script. If you do not find an event for your script action that suits your purpose, you can create a new one.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nCheck box that enables or disables the script action. Select **true** to enable the script action.\n\n</td></tr><tr><td>\n\nExecution order\n\n</td><td>\n\nOrder in which the script will be executed.\n\n</td></tr><tr><td>\n\nCondition script\n\n</td><td>\n\nStatement for a condition under which this script should execute. The system only parses the **script** field if the condition evaluates to true. If you decide to include the condition statement in the script, leave this field blank.\n\n</td></tr><tr><td>\n\nScript\n\n</td><td>\n\nScript that runs when the condition you define evaluates to true. Two additional objects are available in this script:-   event: a [GlideRecord](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/c_GlideRecordScopedAPI.md)- the sysevent that caused this to be invoked. If you want this first parameter on the event, use **event.parm1** or **event.parm2** for the second parameter. For the date/time of the event, use **event.sys\\_created\\_on**. To get the user ID that created the event \\(if there was a user associated\\), use **event.user\\_id**.\n-   current: a GlideRecord- the event scheduled on behalf of \\(incident for example\\).\n\n</td></tr></tbody>\n</table>**Parent Topic:**[System events reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/system-events/system-events-reference.md)\n\n"}}