Parameterized Builds for Jenkins Hook on Bitbucket Server

Hi,

I have configured the Parameterized Builds for Jenkins Hook for one the repositories on our enterprise bitbucket server.

Provided the job name, set the refType as branch and selected PUSH and MANUAL as trigger events, provided the token configured in the Jenkins job and left the rest of the parameters as blank.

The Jenkins url (http://host:port) is configured at the bit bucket project level and no User token has been created either at the Project level or at the Bitbucket server level.

Whenever a commit happens on the repo, no build gets triggered. Unfortunately I do not have access to the bit-bucket server logs so I'm not sure what is going wrong.

I tried doing a manual build from one of the branches under the repo and I get a message 'You do not have permissions to build this job"

Anything I'm missing in the configuration ?

We do not want to use either global token or user tokens and prefer to use the tokens at the job levels, so user tokens is not a solution.

Please let me know if anyone has got this hook working.

FYI: I went through the bitbucket plugin code and I framed the URL as per the code flow and when I do a HTTP post with the URL, I get a 403 "No valid bread crumb found". For Manual builds, the plugin code returns the Permissions message as above when the status code is 403.

Regards,

Sravan

 

1 answer

0 vote
Imran Khan Atlassian Team May 17, 2018

Hi @Sravana Kiran Daruvuri

This is because Jenkins has CSRF protection enabled. This page has more details. https://support.cloudbees.com/hc/en-us/articles/219257077-CSRF-Protection-Explained

I haven't used the above mentioned plugin but I've manually verified triggering Jenkins build with crumb header(as given in the lined page) using CURL. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

175 views 20 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you