Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,644,725
Community Members
 
Community Events
196
Community Groups

Delay or prioritize webhooks, two payloads

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.
Nov 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