<p>Looks like you are using the Gitlab plugin for jenkins?
if so this link should be of help <a href="https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs" rel="noreferrer">https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs</a></p>

CC BY-SA 4.0
2020-04-14T16:56:08.983Z
The implementation/support for gitlab triggers inside the Declarative Directive Generator is thing o' beauty.
tbradt
CC BY-SA 4.0
2018-08-14T21:05:45.697Z
This is 100% exactly what I needed!
Preston Martin
CC BY-SA 4.0
2018-08-14T22:05:40.723Z
In addition to this, you should be able to use Jenkins' "Pipeline Syntax" tool to generate the declarative code from the web UI configuration.
jayhendren
CC BY-SA 4.0
2018-08-14T20:40:24.370Z
2018-08-14T20:40:24.370Z
Nune Isabekyan
<p>I have a Jenkins declarative pipeline that is ran via a webhook from GitLab whenever a change is pushed to my repo. In Jenkins, I have the following trigger option selected:</p>

<p><a href="https://i.sstatic.net/sKc54.png" rel="noreferrer"><img src="https://i.sstatic.net/sKc54.png" alt="GitLab Push Trigger"></a></p>

<p>Is there a way for me to add this trigger to my Jenkins declarative pipeline, if so how? </p>

<jenkins><jenkins-pipeline><gitlab>
Jenkins Pipeline "Build when a change is pushed to GitLab"
Preston Martin
# Jenkins Pipeline "Build when a change is pushed to GitLab"

(Asked by: username_0 on 2018-08-13)

I have a Jenkins declarative pipeline that is ran via a webhook from GitLab whenever a change is pushed to my repo. In Jenkins, I have the following trigger option selected:

[![GitLab Push Trigger](https://i.sstatic.net/sKc54.png)](https://i.sstatic.net/sKc54.png)

Is there a way for me to add this trigger to my Jenkins declarative pipeline, if so how?

**Tags:** jenkins, jenkins-pipeline, gitlab


---

## 1 answers

### Answer by username_1 on 2018-08-14. Score: 6 | Accepted answer

Looks like you are using the Gitlab plugin for jenkins?
if so this link should be of help <https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs>

> **Comments:**
> **username_0**: This is 100% exactly what I needed!  
> **username_3**: In addition to this, you should be able to use Jenkins' "Pipeline Syntax" tool to generate the declarative code from the web UI configuration.  
> **username_2**: The implementation/support for gitlab triggers inside the Declarative Directive Generator is thing o' beauty.  

---

