> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contraforce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Incidents to HaloPSA with a Runbook

> Open a HaloPSA ticket for every ContraForce incident. Build a Halo Integration Runbook, map the webhook payload, and connect it to a ContraForce webhook.

A HaloPSA Integration Runbook can receive ContraForce incident webhooks and open a Halo ticket for each incident. You build the runbook in Halo, then point a ContraForce webhook at the runbook's public Start URL.

> [!NOTE]
>
> **Who is this for?** HaloPSA administrators and MSP security engineers who want ContraForce incidents to land in HaloPSA as tickets. For webhook setup on the ContraForce side, see [Configure Incident Webhooks](https://docs.contraforce.com/guides/technical/configure-webhooks.md).

## Before you start

* You can create Integration Runbooks in HaloPSA (**Configuration > Integrations > Custom Integrations**).
* You are an **Organization Admin** in ContraForce, or someone with that role will create the webhook for you.
* You know the Halo ticket type, client, and priorities the new tickets should use.

## How it works

1. An incident is created in a workspace the webhook covers.
2. ContraForce sends a signed JSON `POST` to the runbook's Start URL.
3. The runbook reads the request into variables and runs a **Create Ticket** step.
4. Halo answers with a `2xx` status, and ContraForce records the delivery as **Success**.

> [!WARNING]
>
> Do not use ticket variables, such as `$TICKETID`, anywhere in this runbook. Halo can't fill them when a runbook is started from an external request, so the run fails and ContraForce receives `HTTP 500`.

## Create the runbook in HaloPSA

**1. Create a new runbook**

In HaloPSA, go to **Configuration > Integrations > Custom Integrations > Integration Runbooks** and click **New**. Enter a name, such as `ContraForce Incidents`, and save.

**2. Allow the runbook to start from a public endpoint**

On the **Details** tab, set **Runbook Start Access** to **Can only be started from Halo and from a public endpoint**. Halo shows the **Start URL** for the runbook. It only accepts `POST` requests.

**3. Choose how Halo authenticates the request**

Set **Authentication** to **Basic Authentication** and enter a username and password. You enter the same pair on the ContraForce webhook later.

**No Authentication** also works, but anyone with the URL can start the runbook. Halo does not recommend it.

Leave **Initial Webhook Verification** off. ContraForce does not answer a challenge handshake.

**4. Map the request into runbook variables**

On the **Details** tab, add the runbook level variables below. Variables added here read the request that started the runbook, so each value starts with `request`.

| Name | Data type | Value |
| - | - | - |
| `cf_type` | string | `<<request^type>>` |
| `cf_is_test` | bool | `<<request^isTest!>>` |
| `cf_number` | int | `<<request^data^incidentNumber!>>` |
| `cf_title` | string | `<<request^data^title?>>` |
| `cf_description` | string | `<<request^data^description?>>` |
| `cf_severity` | string | `<<request^data^severity?>>` |
| `cf_customer` | string | `<<request^data^accountName?>>` |
| `cf_source` | string | `<<request^data^sourceDisplayName?>>` |
| `cf_defender_link` | string | `<<request^data^vendorIdentifiers^defender^portalUrl?>>` |

In Halo's syntax, `^` reads a child property, `!` removes the quotes from a non-string value, and `?` turns a missing value into an empty string.

On `cf_severity`, add **Value Mappings** from ContraForce severities to your Halo priority IDs: `"Critical"`, `"High"`, `"Medium"`, `"Low"`, and `"Informational"`, plus a `*` catch-all.

**5. Build the flow**

Save the runbook so the **Flow chart** tab appears, then add these steps:

| Step | Type | Configuration | Next step |
| - | - | - | - |
| 1 | **Condition** (True/False) | `cf_is_test` equals `true` | Met: step 4. Not met: step 2. |
| 2 | **Action** | Action type **Halo API Action**, action **Create Ticket** | Success: step 3. Failure: step 5. |
| 3 | **End** | Success | |
| 4 | **End** | Success (test events, no ticket) | |
| 5 | **End** | Failure | |

In step 2, edit the default JSON body that Halo provides:

* **Summary**: `[ContraForce #<<cf_number>>] <<cf_title>>`
* **Details**: `<<cf_description>>`, followed by `<<cf_customer>>`, `<<cf_source>>`, and `<<cf_defender_link>>`
* **Priority**: `<<cf_severity!>>`, the mapped Halo priority ID
* **Ticket type** and **client**: your own values

Halo lists the JSON key for each ticket field in its API documentation, under **Configuration > Integrations > Halo API > API Documentation**.

**6. Set the advanced options**

On the **Details** tab, open the **Advanced** section:

* Set **Runbook execution mode** to **Parallel**, so several incidents arriving together are handled at once.
* Set the auto-disable threshold to 3 to 5 failures in a row, as Halo recommends, so a misconfigured runbook stops instead of failing on every incident.
* Optionally, turn on **Create a Ticket after X failed attempts in a row** or a failure notification.

Save the runbook and copy its **Start URL**.

## Connect the ContraForce webhook

**1. Create the webhook**

In ContraForce, go to **Settings → Developers**, click **Add integration**, and select **Webhook**. Follow [Configure Incident Webhooks](https://docs.contraforce.com/guides/technical/configure-webhooks.md#create-a-webhook) with these values:

* **URL**: the runbook's **Start URL**
* **Authentication**: **Basic authentication** with the username and password you set in Halo, or **No authentication** if the runbook uses none
* **Events**: **Webhook Test** and **Incident Created**
* **Workspaces**: the customer workspaces whose incidents should become Halo tickets

**2. Send a test**

Open the webhook and click **Send test** on the **Webhook Test** row. On the **Events** tab, the delivery should show **Success**.

In Halo, the run appears in the runbook's **Logs**, ending at step 4. No ticket is created for a test.

**3. Check that tickets are created**

To try the ticket path before a real incident arrives, point step 1's **Met** branch at step 2 and send another test. You should see a new Halo ticket titled `[ContraForce #0] Test Incident — Webhook Connectivity Verification`. Point the branch back at step 4 afterward.

> [!TIP]
>
> ContraForce makes up to 10 delivery attempts within 5 minutes when your endpoint returns `500` or times out, and every attempt carries the same `X-CF-Event-Id`. Keep the runbook short so Halo answers within 30 seconds. A run that times out may already have created a ticket, and the retry creates another. See [Retries](https://docs.contraforce.com/api-reference/webhook-events.md#retries).

## What ContraForce sends

Each delivery is a JSON `POST` with `Content-Type: application/json`. A shortened `incident.created.v1` body:

```json theme={null}
{
  "type": "incident.created.v1",
  "isTest": false,
  "timestamp": "2026-08-03T14:22:07.881Z",
  "data": {
    "accountName": "Contoso Production",
    "incidentNumber": 4242,
    "title": "Suspicious sign-in from impossible travel",
    "description": "Multiple sign-ins from geographically distant locations within a short window.",
    "severity": "High",
    "source": "sentinel",
    "sourceDisplayName": "Microsoft Sentinel",
    "vendorIdentifiers": {
      "defender": { "incidentId": "9915", "portalUrl": "https://security.microsoft.com/incidents/9915" }
    }
  }
}
```

Test deliveries use the same shape, with `"type": "webhook.test.v1"` and `"isTest": true`. The runbook can ignore the `X-CF-*` request headers. For every field and header, see [`incident.created.v1`](https://docs.contraforce.com/api-reference/webhook-events#incident-created-v1) and [Request Headers](https://docs.contraforce.com/api-reference/webhook-events.md#request-headers).

## Troubleshooting

| Symptom | Likely cause | Fix |
| - | - | - |
| Every delivery fails with `HTTP 500` and no response body | The runbook started but a step failed, often one that uses ticket variables | Open the runbook's **Logs** in Halo, find the failed step, and fix it. Replace ticket variables with the `cf_` variables above. |
| Deliveries fail with `401` or `403` | The username or password differs between Halo and ContraForce | Re-enter them in Halo, then click **Update credentials** on the webhook. |
| Tests succeed but no tickets appear | The webhook isn't subscribed to **Incident Created**, or the workspace isn't covered | Check **Event subscriptions** and **Workspaces** on the webhook's **General** tab. |
| Tickets have empty fields | A variable path doesn't match the payload | Compare the variable values with the sample payload, which you can copy from the info icon beside each event. |
| Duplicate tickets for one incident | A slow run timed out and ContraForce retried it | Shorten the runbook so Halo answers within 30 seconds. |
| The runbook stopped running | Halo's auto-disable threshold was reached | Fix the failing step, re-enable the runbook, and send a test. |

## Related guides

> [card] [Configure Incident Webhooks](https://docs.contraforce.com/guides/technical/configure-webhooks.md)
>
> Create, test, and manage the ContraForce webhook that starts the runbook.

> [card] [Webhook Event Reference](https://docs.contraforce.com/api-reference/webhook-events.md)
>
> Every event type, payload field, header, and retry rule.

> [card] [HaloPSA: Custom Integrations and Runbooks](https://www.usehalo.com/guides/1630)
>
> Halo's guide to runbook start access, steps, and logs.

> [card] [HaloPSA: Runbook Level Variables](https://www.usehalo.com/guides/2736)
>
> Halo's syntax for reading request and response values.

> [!NOTE]
>
> Need help? Contact [support@contraforce.com](mailto:support@contraforce.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.