# xMatters

{% hint style="info" %}
Cortex connects to many third-party vendors whose system interfaces frequently change. As a result, integration behavior or configuration steps may shift without notice. If you encounter unexpected issues, check with your system administrator or refer to the vendor's documentation for the most current information. Additionally, integration sync times vary and are subject to scheduling overrides and timing variance.
{% endhint %}

[xMatters](https://www.xmatters.com/) is an on-call management platform.

Integrating Cortex with xMatters allows you to:

* Pull in on-call rotation data and escalation policies
  * The on-call user or team will appear in the **Current On-call** block on an entity's details page.
  * You can also view on-call information on an entity page in its side panel under **Integrations > On-call**.
* Trigger xMatters incidents from Cortex
* Create [Scorecards](#scorecards-and-cql) that track progress and drive alignment on projects involving your xMatters services

## How to configure xMatters with Cortex

### Configure the integration in Cortex

1. In Cortex, navigate to the [xMatters settings page](https://app.getcortexapp.com/admin/integrations/xmatters):
   1. Click **Integrations** from the main nav. Search for and select **xMatters**.
2. Click **Add configuration**.
3. Configure the xMatters integration form:
   * **Username** and **Password**: Enter your xMatters username and password.
   * **Organization slug**: Enter the organization slug for your xMatters instance.
     * This can be found in the URL for your instance (e.g., `https://.xmatters.com`)
4. Click **Save**.

To modify the integration configuration, see [Modifying an existing integration configuration](/ingesting-data-into-cortex/integrations.md#modifying-an-existing-integration-configuration).

## Trigger an incident

While viewing an entity in Cortex, you can trigger an incident in xMatters:

1. In Cortex, navigate to an entity. On the left side of an entity details page, click **On-call & incidents**.
2. In the upper right side of the entity's "On-call" page, click **Trigger incident**.
3. Configure the incident modal:
   * **Summary**: Enter a title for the incident.
   * **Description**: Enter a description of the incident.
   * **Severity**: Select a severity level.
4. At the bottom of the modal, click **Trigger incident**.
   * A confirmation screen will appear. In the confirmation, click the link to view the incident in xMatters.

## How to connect Cortex entities to xMatters

### Discovery

By default, Cortex will use the [Cortex tag](/ingesting-data-into-cortex/entities-overview/entities.md#cortex-tag) (e.g. `my-entity`) as the "best guess" for xMatters group. For example, if your Cortex tag is `my-entity`, then the corresponding group in xMatters should also be `my-entity`.

If your xMatters group don’t cleanly match the Cortex tag, you can override this in the Cortex entity descriptor.

### Editing the entity descriptor

```yaml
x-cortex-oncall:
  xmatters:
    id: engineering_group
    type: SERVICE
```

| Field  | Description                   | Required |
| ------ | ----------------------------- | :------: |
| `id`   | Name of the group in xMatters |   **✓**  |
| `type` | `SERVICE`                     |   **✓**  |

## Using the xMatters integration

#### Entity pages

Once the integration with xMatters is configured, you'll be able to find the user or team on call in the **Current On-call** block on an [entity's details page](/ingesting-data-into-cortex/entities-overview/entities/details.md).

You can find more detailed information from the xMatters integration in the entity sidebar under **On-call & incidents > xMatters**.

The schedule associated with a given entity will be hyperlinked in the **Escalation Policy** block and the group will be hyperlinked in the **Service** block.

Under the Escalations section, you'll find each level associated with the policy. Owners assigned to each level will also be hyperlinked to the user or team's on-call page in xMatters.

### Scorecards and CQL

With the xMatters integration, you can create Scorecard rules and write CQL queries based on xMatters services.

See more examples in the [CQL Explorer](https://app.getcortexapp.com/admin/cql-explorer) in Cortex.

<details>

<summary>Check if on-call is set</summary>

Check if entity has a registered group.

**Definition:** `oncall (==/!=) null`

**Example**

For a Scorecard focused an production readiness, you can use this expression to make sure on-call is defined for entities:

```
oncall != null
```

This rule will pass if an entity has an on-call schedule set.

</details>

<details>

<summary>Number of escalations</summary>

Number of escalation tiers in escalation policy.

**Definition:** `oncall.numOfEscalations()`

**Example**

This expression could be used in a Scorecard focused on production readiness or service maturity. For example, you can check that there are at least two tiers in an escalation policy for a given entity, so that if the first on-call does not ack, there is a backup:

```
oncall.numOfEscalations() >= 2
```

While making sure an on-call policy set is a rule that would be defined in a Scorecard's first level, a rule focused on escalation tiers would make more sense in a higher level.

</details>

<details>

<summary>On-call metadata</summary>

On-call metadata, including type, ID, and name.

**Definition:** `oncall.details()`

**Example**

You can use this expression in the Query builder to find all entities with an on-call rotation associated with a given group. Let's say we want to find all entities that the "Sample team" is on-call for.

```
oncall.details().id.matches("Sample*") == true
```

Because the team/group name is registered in the `ID` field in the entity descriptor, we would use `.id` instead of `.name`.

</details>

### View integration logs <a href="#still-need-help" id="still-need-help"></a>

## Still need help?[​](https://docs.cortex.io/docs/reference/integrations/aws#still-need-help) <a href="#still-need-help" id="still-need-help"></a>

The following options are available to get assistance from the Cortex Customer Engineering team:

* **Email**: <help@cortex.io>, or open a support ticket in the in app Resource Center
* **Slack**: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a `:ticket:` reaction to a question in Slack, and the team will respond directly.

Don’t have a Slack channel? Talk with your Customer Success Manager.


---

# Agent Instructions: 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:

```
GET https://docs.cortex.io/ingesting-data-into-cortex/integrations/xmatters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
