> 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/playbooks/automations/common-scripts-to-use-in-automations.md).

# Common Scripts to use in Automations

Cortex XSOAR comes out-of-the-box with a number of common scripts, which can be used in playbooks and commands, the majority of which are contained in the **Base** and **Common Scripts** content packs.

The **Common Scripts** content pack includes scripts that are commonly used, such as **EmailReputation**, **RunDockerCommand**, **ConvertXMLToJson**, etc.

The **Base** content pack is a core pack, which helps you get started and includes various scripts including the common scripts, which can be used in other JavaScript, Python and PowerShell scripts.

**Common Scripts**

Common scripts contain common code (functions, variables, etc.) that can be used across scripts and can be embedded, when writing your own scripts and integrations. They are used to enhance the API in other scripts and integrations. For example, the **`tableToMarkdown`** function in the **`CommonServer`** script, takes a JSON and transforms it to markdown. You can call this function from integrations and scripts that you author.

In the **Automation** page you can view/edit the following common scripts:

* **CommonServer**

  The **Common Server** script contains JavaScript functions and variables that can be in other scripts when writing your own scripts and integrations.

  The script contains nearly 200 functions/variables , such as **`tabletoMarkdown`**, **`closeInvestigation`**, **`SetSeverity`**, etc.

  You can copy the script and add new functions/variables or add your own functions to the **CommonUserServer** script. You can also use this script to override the existing scripts in the **CommonServer** script.
* **CommonServerPython**

  The **CommonServerPython** script contains Python functions that can be in other scripts when writing your own scripts and integrations.

  The script contains over 400 functions, such as **`appendContext`**, **`vtCountPositives`** (which counts the number of detected URLs in the War Room entry), **`datetime_to_string`**, (which converts a datetime object into a string), etc.

  You can copy the script and add new functions/variables or add your own functions to the **CommonServerUserPython** script. You can also use this script to override the existing scripts in the **CommonServerPython** script.
* **CommonServerPowerShell**

  The **CommonServerPowerShell** script contains PowerShell arguments/functions that can be in other scripts when writing your own scripts and integrations.

  The script contains many arguments/functions, etc. such as **`SetIntegrationContext`**, **`Write-HostToLog`** (which writes to the demisto.log), **`ReturnOutputs`** (which returns results to the user more intuitively), etc.

  You can copy the script and add new arguments/functions or add your own to the **CommonServerUserPowerShell** script. You can also use this script to override the existing scripts in the **CommonServerPowerShell** script.


---

# 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/playbooks/automations/common-scripts-to-use-in-automations.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.
