> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/work-with-slas/customize-sla-scripts.md).

# Customize SLA Scripts

Scripts in Cortex XSOAR enable you to automate processes. In the context of SLA, you can create scripts that will perform specific actions when the SLA is breached. Each SLA script must include the SLA tag.

Cortex XSOAR comes with an out-of-the-box script, called SendEmailOnSLABreach, that sends an email to specific users when the script is triggered. By default, the script sends an email to the incident assignee, but you can manually edit the script to add additional recipients..

When you create your own scripts, the following arguments are automatically added, in addition to the basic elements provided with every script (for example, current investigation and current incident):

* field - the current triggered SLA breach field object (contains: name, cliName, threshold, etc.).
* fieldValue - the current triggered SLA field's value, for example the startDate.

  The following table lists the different properties in the SLA timer field value:

  | Property         | Type             | Description                                                                                                                                                                                                                          |
  | ---------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | dueDate          | Date             | The date by which the SLA for this timer is due.                                                                                                                                                                                     |
  | breachTriggered  | Boolean          | Whether the timer was already in breach of the SLA.                                                                                                                                                                                  |
  | sla              | INT (in minutes) | The period defined as the SLA for this timer. This is the value that you defined in the Timer field.                                                                                                                                 |
  | endDate          | Date             | The date at which the SLA timer completed.                                                                                                                                                                                           |
  | lastPauseDate    | Date             | The last date at which the SLA timer was paused.                                                                                                                                                                                     |
  | startDate        | Date             | The date at which the SLA timer was started.                                                                                                                                                                                         |
  | accumulatedPause | INT (in seconds) | The total number of seconds that the timer was in a paused state.                                                                                                                                                                    |
  | totalDuration    | INT (in seconds) | The total number of seconds that the timer was running. This property is populated after the timer is stopped.                                                                                                                       |
  | slaStatus        | INT              | <p>Represents the Cortex XSOAR SLA status. Values are:</p><p>-1 - The SLA is not yet set.</p><p>0 - The SLA is within the allotted range.</p><p>1 - The SLA is below the defined risk threshold.</p><p>2 - The SLA is in breach.</p> |
  | runStatus        | String           | <p>Represents the current status of the timer. Values are:</p><ul><li>idle</li><li>running</li><li>paused</li><li>ended</li></ul>                                                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/work-with-slas/customize-sla-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
