> 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/cortex-xsoar-8-on-prem/8.13/configure-cortex-xsoar/slas/create-sla-scripts.md).

# Create SLA scripts

Create SLA scripts in Cortex XSOAR 8.13 On-prem.

## Create SLA scripts

When you create your 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` and more.).
* `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 is 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 is 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><ul><li><code>-1</code>: The SLA has not been set.</li><li><code>0</code>: The SLA is within the allotted range.</li><li><code>1</code>: The SLA is below the defined risk threshold.</li><li><code>2</code>: The SLA is in breach.</li></ul> |
| `runStatus`        | String           | <p>Represents the current status of the timer. Values are:</p><ul><li><code>idle</code></li><li><code>running</code></li><li><code>paused</code></li><li><code>ended</code></li></ul>                                                                                                                   |

See the following video for a practical example of creating an SLA script and how to use it in a playbook: [SLA scripts](https://www.youtube.com/watch?v=QO1rc2VhOmc).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xsoar-8-on-prem/8.13/configure-cortex-xsoar/slas/create-sla-scripts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
