-
Notifications
You must be signed in to change notification settings - Fork 620
Open
Description
Summary:
When a Jenkins job is triggered by a GitLab Note webhook on a Merge Request, the environment variable gitlabMergeRequestState is not populated, even though the webhook payload includes the merge_request.state field.
This causes pipelines triggered by MR comments to lose context about the MR’s current state (opened, merged, closed), which breaks consistency with normal Merge Request event triggers.
What Operating System are you using (both controller, and any agents involved in the problem)?
N/A
Reproduction steps
- In GitLab, create a Merge Request.
- Add a comment (note) on the MR that triggers a Jenkins pipeline (via the GitLab plugin).
- In the Jenkinsfile, add:
pipeline {
agent any
stages {
stage('debug') {
steps {
sh 'env | grep gitlabMergeRequest'
}
}
}
}
Expected Results
gitlabMergeRequestState is missing
Actual Results
gitlabMergeRequestIid, gitlabSourceBranch, and gitlabTargetBranch is present but gitlabMergeRequestState is missing
Anything else?
No response
Are you interested in contributing a fix?
I think the change needs added here to include the merge request state
Line 70 in df99f23
| return causeData() |
Metadata
Metadata
Assignees
Labels
No labels