> 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.10/configure-cortex-xsoar/dashboards-and-reports/widgets/add-a-widget-in-the-war-room.md).

# Add a widget in the War Room

Add script-based War Room widgets in Cortex XSOAR 8.10 On-prem.

You can add a script-based widget in the War Room by running a command. After creating a script in the **Scripts** page, to add the widget you need to run a command in the War Room.

1. [Create a custom widget using a script](/cortex-xsoar-8-on-prem/8.10/configure-cortex-xsoar/dashboards-and-reports/widgets/create-a-custom-widget-using-a-script.md).
2. Go to the **War Room** and run the command: **!\<scriptName>**

   where \<scriptName> is the name of the script you created in step 1.

<details>

<summary>Add a custom widget in the War Room example</summary>

**Example**

Add a custom widget that returns indicator severity in an incident as a bar chart

1. Use the following script.

   ```programlisting
   commonfields:
     id: ee3b9604-324b-4ab5-8164-15ddf6e428ab
     version: 49
   name: IndicatorWidgetBar
   script: |-
     # Constants
     HIGH = 3
     SUSPICIOUS = 2
     LOW = 1
     NONE = 0

     indicators = []
     scores = {HIGH: 0, SUSPICIOUS: 0, LOW: 0, NONE: 0}
     incident_id = demisto.incidents()[0].get('id')

     foundIndicators = demisto.executeCommand("findIndicators", {"query":'investigationIDs:{}'.format(incident_id), 'size':999999})[0]['Contents']

     for indicator in foundIndicators:
         scores[indicator['score']] += 1

     data = {
       "Type": 17,
       "ContentsFormat": "bar",
       "Contents": {
         "stats": [
           {
             "data": [
               scores[HIGH]
             ],
             "groups": None,
             "name": "high",
             "label": "incident.severity.high",
             "color": "rgb(255, 23, 68)"
           },
           {
             "data": [
               scores[SUSPICIOUS]
             ],
             "groups": None,
             "name": "medium",
             "label": "incident.severity.medium",
             "color": "rgb(255, 144, 0)"
           },
           {
             "data": [
               scores[LOW]
             ],
             "groups": None,
             "name": "low",
             "label": "incident.severity.low",
             "color": "rgb(0, 205, 51)"
           },
           {
             "data": [
               scores[NONE]
             ],
             "groups": None,
             "name": "unknown",
             "label": "incident.severity.unknown",
             "color": "rgb(197, 197, 197)"
           }
         ],
         "params": {
             "layout": "horizontal"
         }
       }
     }

     demisto.results(data)
   type: python
   tags:
   - dynamic-section
   enabled: true
   scripttarget: 0
   subtype: python3
   runonce: false
   dockerimage: demisto/python3:3.7.3.286
   runas: DBotWeakRole
   ```
2. Add the script in the War Room by running the **`!IndicatorWidgetBar`** command.

   The custom widget appears in the War Room.

   ![widget\_indicatorsbar.png](https://4220554293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM6t3x619iLxkOSWNFxz0%2Fuploads%2Fgit-blob-ddd5b3d5744d0fa338e493cea0ec49e1106bb3ba%2F6d4d360326f24e0c90f273b46f226f23c3146361c0093a6a7956a6e59ed62cee.png?alt=media)

</details>


---

# 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.10/configure-cortex-xsoar/dashboards-and-reports/widgets/add-a-widget-in-the-war-room.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.
