question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pull request is not triggered when bitbucket webhook sends pullrequest:* event

See original GitHub issue

Your checklist for this issue

  • Jenkins version Jenkins version: 2.171
  • Plugin version Plugin version: 2.4.4
  • Bitbucket cloud I’m using Bitbucket cloud
  • Bitbucket server and version

Description

I have setup the bitbucket cloud to notify our jenkins server to do a build and it is working but when a pull request is created or updated, it doesn’t trigger a build.

The jenkins server is also setup using Bitbucket Team/Project and it is working fine, just the pull request part.

There’s nothing wrong with my Jenkinsfile since if a manually trigger the build on pull request, it will execute the steps defined in there.

image

image

image

Here is by Jenkinsfile:

def ISSUES
pipeline {
    agent none
    stages {
        stage('Executing Tests') {
            parallel {
                stage('UI/UX Test') {
                    agent {
                        docker {
                            image 'rodolforicojr/katalon-jenkins'
                            args "-u root"
                        }
                    }
                    when {
                        changeRequest comparator: 'EQUALS', target: 'master'
                    }
                    steps {
                        dir('tests/katalon') {
                            script{
                                ISSUES = jiraSearch 'project = WCWT AND issuetype = Test AND "Cucumber Test Type" in (Scenario, "Scenario Outline")'
                            }

                            step([$class: 'XrayExportBuilder', filePath: 'Include/features', issues: ISSUES.join(';'), serverInstance: 'f9b8d4af-5dcb-4361-bad4-d0f2b1f7e49b'])

                            sh 'katalon-execute.sh -browserType="Firefox" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/RunFeatures" -executionProfile="staging"'
                        }
                    }
                    post {
                        always {
                            dir('tests/katalon') {
                                archiveArtifacts artifacts: 'report/**/*.*', fingerprint: true
                                // junit 'report/**/JUnit_Report.xml'

                                cucumber failedFeaturesNumber: -1, failedScenariosNumber: -1, failedStepsNumber: -1, fileIncludePattern: '**/*.json', jsonReportDirectory: 'report/cucumber_report', pendingStepsNumber: -1, skippedStepsNumber: -1, sortingMethod: 'ALPHABETICAL', undefinedStepsNumber: -1

                                sh label: '', script: 'cp report/cucumber_report/$(ls report/cucumber_report -t1 | head -n 1)/cucumber.json report/cucumber_report/cucumber.json'

                                step([$class: 'XrayImportBuilder', endpointName: '/cucumber', importFilePath: 'report/cucumber_report/cucumber.json', serverInstance: 'f9b8d4af-5dcb-4361-bad4-d0f2b1f7e49b'])

                                sh label: '', script: 'rm -R report'
                            }
                        }
                    }
                }
            }
        }
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

7reactions
hubezcommented, Jul 7, 2019

I found the issue to my problem! My issue was I had a Build strategy to build Named branches, and I think this filter also filtered out Pull Requests. Once I removed this, Pull Requests started to build on creation.

I think my path of how I got stuck in it was this: Reproduce:

  1. Install plugin version 2.4.1
  2. Create Bitbucket Branch Source Plugin project
  3. Configure a Build strategies -> Named Branches -> Names (regex) = “.*”
  4. Do builds, branches trigger automatically
  5. Create branch, then pull request, notice pull request won’t build
  6. Install plugin version 2.4.5
  7. Create branch, then pull request, notice pull request still won’t build

Fix:

  1. Remove Build strategies -> Named Branches -> Names (regex) = “.*”
  2. Create branch, then pull request, notice pull request BUILDS!
0reactions
stale[bot]commented, Sep 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bitbucket YAML Pull Request Trigger Not Working (webhook ...
The pull request webhook is returning 500. "repo:push" webhooks are 200 response and work but "pullrequest:updated" do not.
Read more >
Bitbucket Webhooks Troubleshooting
Bitbucket Push And Pull Request Plugin will not work if the Bitbucket Plugin is installed. 1) Endpoint. This applies to Bitbucket repositories configured...
Read more >
Solved: How to trigger a webhook when a commit is pushed t...
I am currently using the "Pull Request Opened" webhook event to trigger a CI ... While the Atlassian support page for Bitbucket Server...
Read more >
Drone ignores pullrequest:created webhook sent from ...
Drone does not support pull request events for bitbucket cloud at the moment. Bitbucket also has an open issue about this.
Read more >
Bitbucket Push and Pull Request - Jenkins Plugins
Bitbucket Push And Pull Request Plugin will not work if the old ... for jobs triggered through the BitBucket webhook (and not for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found