# Pipeline Event Merge Requests w/GitLab

**URL:** <https://drone.discourse.group/t/pipeline-event-merge-requests-w-gitlab/1165>\
**Category:** Drone Support\
**Created:** [February 27, 2020, 5:37pm UTC](https://drone.discourse.group/t/pipeline-event-merge-requests-w-gitlab/1165 "2020-02-27T17:37:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lo\_ronk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/lo_ronk/32/5519_2.png) [@lo\_ronk](https://drone.discourse.group/u/lo_ronk)\
**Post date:** [February 27, 2020, 5:37pm UTC](https://drone.discourse.group/t/pipeline-event-merge-requests-w-gitlab/1165/1 "2020-02-27T17:37:11Z")

</div>

Hello –

I am having issues getting my pipeline to trigger when a Merge Request is created in GitLab and am unsure if this is possible. I have two scenarios I would like to try out:

1. Execute Drone pipeline once a Merge Request is created

OR

1. Once the Drone pipeline succeeds create a Merge Request in Gitlab

For option 1) I have tried adding the following in my pipeline but unfortunately doesn’t kickoff the pipeline once I create a merge request in my `branch_name`:

```auto
kind: pipeline
type: docker
name: my-pipeline

trigger:
  branch: branch_name
  event: pull_request

```

I am unsure if this is the correct event type that I am looking for with my git hook.

Is there a way to accomplish either (or both) of these scenarios with Drone and GitLab?

Thanks!

---

<div class="post-metadata">

**Author:** ![ashwilliams1](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ashwilliams1/32/5549_2.png) [@ashwilliams1](https://drone.discourse.group/u/ashwilliams1)\
**Post date:** [February 27, 2020, 5:52pm UTC](https://drone.discourse.group/t/pipeline-event-merge-requests-w-gitlab/1165/2 "2020-02-27T17:52:54Z")

</div>

I see two potential issues.

First is that event and branch are array values and should be adjusted accordingly:

```diff
trigger:
- event: pull_request
+ event:
+ - pull_request

```

The second is that the branch field should probably be removed. This refers to the target branch of the pull request, not the source branch (this is a common misconception). If you try to filter based on source branch your pipeline will not be executed.

---

<div class="post-metadata">

**Author:** ![lo\_ronk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/lo_ronk/32/5519_2.png) [@lo\_ronk](https://drone.discourse.group/u/lo_ronk)\
**Post date:** [February 27, 2020, 6:04pm UTC](https://drone.discourse.group/t/pipeline-event-merge-requests-w-gitlab/1165/3 "2020-02-27T18:04:10Z")

</div>

That was the exact issue (source branch misconception). Thank you for the help!
