Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delay or prioritize webhooks, two payloads

Nora Rydding
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2022

Hi!

We have a job in Jenkins which we want to trigger on push, but also on pull request opened and pull request branch updated. This job is configured to use the Generic Webhook Trigger plugin with a token.

However, by doing this, a push to the pull request branch also fires the regular push webhook. Whenever there is an event related to Pull Request, that is the payload we want, but we only receive the "repo:refs_changed" event. It seems that Jenkins only recieves the payload from one of the triggers.

10:10:00  Generic Cause
10:10:00  Generic Cause
10:10:00  GenericWebhookEnvironmentContributor
10:10:00   Received:
10:10:00  
10:10:00  {"eventKey":"repo:refs_changed",.......}

As you can see on this log from jenkins, it has been triggered twice, which is correct (the push, and pull request branch updated event). Is there any way to add a delay to the push event on the webhook or somehow change the order the payloads are sent from Bitbucket so that we can continue or Jenkinsjob with the payload we want?

1 answer

0 votes
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2022

Hi @Nora Rydding 

 

Thank you for your question!

Maybe it is a good case for the jenkins-job-trigger pipe:

script:
  - pipe: atlassian/jenkins-job-trigger:0.3.1
    variables:
      JENKINS_URL: 'http://my-jenkinsio-host:8080/job'
      JENKINS_USER: $JENKINS_USER
      JENKINS_TOKEN: $JENKINS_TOKEN
      JOB_NAME: 'staging-awesome-project-job'

 

Best regards,
Oleksandr Kyrdan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events