# GitLab Changes Integration Guide | PagerDuty

Configure the GitLab integration

## GitLab + PagerDuty Benefits

- Send merge request events from GitLab to PagerDuty services to provide context for anyone using PagerDuty.
- Responders may review change events within the Recent Activity timeline of a PagerDuty service during incident triage or hypercare. They can also see recent changes on the incidents of the service and review all changes in a comprehensive list of recent changes across all services.

## Requirements

> **AIOps / Signal Intelligence Feature:** This feature is included with the [PagerDuty AIOps](/ai-automation/aiops/overview) add-on, or included as Signal Intelligence in PD Reliability Platform plans. To sign up for a trial of PagerDuty AIOps features, read [PagerDuty AIOps Trials](/ai-automation/aiops/overview#pagerduty-aiops-trials).

> **AIOps Service Configuration:** Your service configuration must have AIOps enabled to use this feature. AIOps Service Configuration is in Limited General Availability — see [Configurable Service Settings](/incident-management/services/configurable-service-settings#manage-aiops) for more information and enablement steps.

**In PagerDuty**: This integration requires a [Manager base role](/account-admin/advanced-permissions#base-roles) or higher to configure.

**In GitLab**: This integration requires a Maintainer, Admin, or Owner role to configure.

## How It Works

- When a `merge_request` event occurs within a GitLab repository, a webhook is sent to the endpoint of the integrated PagerDuty service.
- These events are viewable as [change events](/ai-automation/aiops/recent-changes) in the Recent Activity timeline of the service, on incidents associated with that service, and in a global list of all changes. They do not generate alerts, incidents, or notifications.

> **Change Events:** For more information about how PagerDuty surfaces change events on services, incidents, and in the [Service Directory](/incident-management/services/service-directory), see [change events](/ai-automation/aiops/recent-changes).

## Integration Walkthrough

### In PagerDuty

> **Tip:** Mapping your GitLab events to the PagerDuty service that represents what you are changing allows responders to quickly identify recent changes on their service when they receive a notification for an incident.

1. In your PagerDuty account, navigate to **Services**  →  **Service Directory** and click the **name** of your preferred service.
2. Select the **Integrations** tab and click **Add an integration**.
3. Search for and select **GitLab** and click **Add**.

![Integration search results with GitLab selected in the list and an Add button](/images/kb/8efd921b52e781b532bdfcbfc42695ddd4546a10be6836c4ed93788b483f582e-gitlab_integration.webp)
*Select GitLab*

4. In the list of integrations, click **** to the right of the GitLab integration.

![List of integrations for the service with a chevron icon to expand the GitLab integration row](/images/kb/03d90186f5a53ac6399da7a18eabe5c518bf1fa1308ef611e8d200f43d07c33c-integration_details.webp)
*Integration details*

5. In the **Integration URL** section, click **** to copy the integration URL to your clipboard. It is in the following format: `https://events.pagerduty.com/integration/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/change/enqueue`. Save this URL in a safe place for use in the [following section](#in-gitlab).

#### Branch Tracking

By default, the integration tracks changes on your `main`/`master` branch. If you would like to change which branch is tracked, or track multiple branches, you can do this in the PagerDuty web app. If you do not wish to change which branch is tracked, skip ahead to the following section [In GitLab](#in-gitlab).

1. In your PagerDuty account, navigate to **Services**  →  **Service Directory** and click the **name** of the service with your GitLab integration.
2. Select the **Integrations** tab and click **** to the right of the GitLab integration.

![Integration row with a settings gear icon highlighted next to the GitLab integration](/images/kb/c587018bfb4649013241cf4ec6264add6eafb84f4bcf2d1eb7429975ff057a74-integration_settings.webp)
*Integration settings*

3. On the right-hand side, click **Edit Integration**.
4. In the **branch** field, enter the name of the branch you would like to track. **Note**: If you would like to track multiple branches, add a space between the name of each branch, for example: `feature-branch-1 feature-branch-2 feature-branch-3`.
5. Click **Save changes**.

### In GitLab

1. In your GitLab account, navigate to the project where you would like to track changes. In the left-side menu, select **Settings**  →  **Webhooks**.
2. Paste the integration URL you generated in PagerDuty (in the previous section) into the **URL** field.
3. Under the **Trigger** header, deselect **Push events** and select **Merge request events**.
4. Click **Add webhook**.

## Using the Integration

After you have [added a webhook to your GitLab project](#in-gitlab), you can test the integration by creating a [merge request](https://docs.gitlab.com/ee/user/project/merge_requests/) in the project. In the PagerDuty web app, navigate to the integrated service, click its **title**, and you see an entry in the **Recent Changes** section:

![A screenshot of the PagerDuty UI detailing an example change event](/images/kb/92e72725f7104165e3c60b1c55b9f62fcf23a874f486f23d951e4e6b91e2d703-change_event.webp)
*Example change event*

## FAQ

**Is it possible to modify change events using Event Orchestration?**

Not at this time, but we are interested to learn about what you would like to accomplish. [Contact our Support team](https://www.pagerduty.com/contact-us/#contact-support) with your use case and feedback.

**Is it possible to send change events from multiple GitLab branches?**

Yes, you can add any number of integrations to a single service, including multiple GitLab integrations. See the section [Branch Tracking](#branch-tracking) for information about customizing which branch an integration is associated with.

**Are change events viewable in Slack or the mobile app?**

Not at this time, but we would like to hear your feedback. [Contact our Support team](https://www.pagerduty.com/contact-us/) with your feedback.
