# PagerDuty + JovianX Integration

JovianX supports integration with PagerDuty, to automatically create and triggers production incidents within PagerDuty, and automatically mark resolved incidents when they are resolved.

## Benefits

* Notify on-call respondents when the application status of an account turns to `Error` state.&#x20;
* Automatically mark issues as Resolved when application's status switches from Error to Running.&#x20;
* One-way event notification forwards from JovianX to PagerDuty.

## How it works

JovianX Automation feature allows triggering external cloud services on events happening within JovianX, and data from JovianX to the service. This integration uses the `Application Error` event, which triggers the PagerDuty Events V2 API, to create an incident within PagerDuty.&#x20;

## Requirements

* PagerDuty integrations require an Admin base role for account authorization. If you do not have this role, contact an Admin or Account Owner within your organization to configure the integration.
* PagerDuty <> JovianX integration requires an **`integration key`**, and alerts and incidents must be enabled. Integration keys are generated by creating a [new service](https://dev-jovianx.pagerduty.com/services/new) or by creating a new integration for an existing service.

## Support&#x20;

If you need help with this integration, contact <support@Jovianx.com> or open a ticket with the customer support portal.&#x20;

## Integration Walkthought &#x20;

Follow steps below to setup the integration between JovianX and PagerDuty.

## In PagerDuty&#x20;

#### Integrating With a PagerDuty Service

1. On the top menu, click on  **Configuration** > **Services**.
2. Add an I**ntegration** to a service through **ONE** of the following methods:
   1. Add integration to **existing service** - Click the name of the service where you want to add the integration. Then select the Integrations tab and click **New Integration,** and copy the **Integration Key**. The Integration Key will be used to connect JovianX Platform to the PagerDuty account.<br>
   2. **Create new Service** -  Click on "+ New Service" button, set the name of the new service to "JovianX Platfrom", then select **Integration Type**: **Use our API directly** with **Events API v2,** configure the rest of the Pagerduty settings, and click on "**Add Service**" button at the bottom of the screen. On the next screen navigate to the **Integrations** tab, and copy the **Integration Key**. The Integration Key will be used to connect JovianX Platform to the PagerDuty account.

![Copy the PagerDuty Integration Key](https://2226616041-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdZQYW5C5jmCEGbhAlO%2F-M8pPGRPOZvUHGWDaWFr%2F-M8paK2y4Te4DJ19akwL%2Fimage.png?alt=media\&token=ff0322c2-4de2-49b5-9c56-9e95c172c195)

{% embed url="<https://youtu.be/mAkuu76syOE>" %}
PagerDuty Service Creation for JovianX Integration
{% endembed %}

## In JovianX Platform

#### Create New JovianX Event Automation Rule&#x20;

Create a new Rule&#x20;

1\. On the left menu click on `Automation` and then click on `Create Rule`

![](https://2226616041-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdZQYW5C5jmCEGbhAlO%2F-M8f4TplYMrerKY2ZU74%2F-M8fV2o5519JS7fXdVV_%2Fimage.png?alt=media\&token=263a2e49-2eb5-49f3-bb04-3855d5731496)

2\. Create a new rule with the following configuration:

* [ ] Choose the event type: `Application Error`
* [ ] Application Type: `Webhook`
* [ ] URL: `https://events.pagerduty.com/v2/enqueue`
* [ ] Content Type: `JSON` with the following content:

```javascript
{
  "event_action": "trigger",
  "payload": {
    "summary": "Account {{account_display_name}} changed to ERROR state.",
    "source": "JovianX Platform",
    "severity": "error"
  },
  "routing_key": "<PAGERDUTY INTEGARTION KEY>"
}
```

3\. To test the configuration click on **Test**

![](https://2226616041-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdZQYW5C5jmCEGbhAlO%2F-MGmcJTSgTUU4q2jFqZ0%2F-MGmdBb7_vDx5tulLkns%2Fimage%20\(1\)%20\(1\).png?alt=media\&token=3b07ebf9-5632-48e3-adc5-f8eb521324f3)

A successful call to PagerDuty should result in a similar response. On the PagerDuty console a new incident should be created.<br>

![](https://2226616041-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdZQYW5C5jmCEGbhAlO%2F-MCIOgYcQvz9rLYuRLK0%2F-MCIOyV7NEiMEIednYT2%2Fimage.png?alt=media\&token=23947438-2d26-48ae-b0b6-b90922c3261f)

![](https://2226616041-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdZQYW5C5jmCEGbhAlO%2F-MGmcJTSgTUU4q2jFqZ0%2F-MGmdR46O5NPXqkczV3P%2Fimage%20\(2\)%20\(1\).png?alt=media\&token=4208d402-c3d7-4403-9b5d-98fbe7a3933d)

4\. Click on **Save** if the test result was successful.&#x20;

{% hint style="info" %}
Note: You can read further about PagerDuty API on the PagerDuty API documentation.&#x20;

<https://developer.pagerduty.com/docs/events-api-v2/trigger-events/>
{% endhint %}
