Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Enable a hook for multiple repository using REST-API

Hi team

Is there a way to enable "Simple bitbucket commit checker" configurations for multiple git repos in bitbucket.

I do not want to do that one-by-one. Please suggest a way to perform this in one go.

Please help.

1 answer

1 accepted

0 votes
Answer accepted

I wrote a script (perl) to perform this task using Bitbucket-API.

What I basically did within my script

  • Fetched a list of all repositories from Bitbucket
  • Filtered the list for my needs
  • Iterated over the list and enabled/disabled all hooks I wanted to for each repository ..

Just a little basic scripting ...

Hi Kilian, Thanks for writing back.

Even I tried to make things work but rest-api command is not working for me  and I am all stuck.

Can you please share your perl script for me to have a look. I would appreciate.


Anyone have any idea, why below rest-api is not working. I am trying to enable a hook called sscc for one the repository using rest-api. It gave me an error.

curl -sS -X PUT -u username:pass http://<hostname>:7990/rest/api/1.0/projects/ABC/repos/sample_repo/settings/hooks/se.bjurr.sscc.sscc/enabled | jq -r



"errors": [
"context": null,
"message": "An error occurred while processing the request. Check the server logs for more information.",
"exceptionName": null

@Akul Bhatnagar - sorry I'm not allowed to share my code due to our policies ;-/


Just an guess, why your curl request might not work: your hook-key "se.bjurr.sscc.sscc" looks strange in comparison to what I use: "com.atlassian.bitbucket.server.bitbucket-bundled-hooks:force-push-hook" (mind the colon)

Try to get the available hooks first (using and check whether the hook key you used is correct

I tried for number of hooks with correct add-on key which their developers have mentioned, but still the same error.


Can you share your curl command with me, hope that'll not be considered as a code.

I don't use curl very often - for testing I use a REST-client addon for Google Chrome (Postman:

I just used my standard Bitbucket authorization data and did a simple http GET:





Edit: Just tried a simple GET via curl (same REST-call as above):


curl -u user:secret


This worked fine and returned the same result as above



I saw your addon key and got a question


:force-push-hook – is this part of key OR you have appended it knowingly 

Running a HTTP Get request on gives a full list of available hooks for the given repository. (Thats what I meant when I wrote above: Try to get the available hooks first (using and check whether the hook key you used is correct)


Looking at this list shows that :force-push-hook IS part of the key ....

Having a look at my available hooks, I noticed that we've also got your desired SSCC hook available. The correct key seems to be:



I wanted to share some additional information on the above, had some trouble initially figuring out how to enable/configure hook settings. In my case we are using 'Yet Another Commit Checker' and our organisation wants to enable enable 'reqireJira Issue' enabled. 

I used the below command to achieve it:

curl -k --user user:secret -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -X PUT{projectKey}/repos/{repositorySlug}/settings/hooks/com.isroot.stash.plugin.yacc:yaccHook/enabled -d '{"requireJiraIssue": true}'

com.isroot.stash.plugin.yacc:yaccHook - is the {hookKey}



Hi @Sai N, thanks for the very useful information. I am very curious about whether the 'reqireJira Issue' is defined by the 'com.isroot.stash.plugin.yacc:yaccHook' plugin?

And I want to enable a plugin 'com.ngs.stash.externalhooks.external-hooks:external-merge-check-hook' which needed some params, do you know which **API** I can use to config it(not from the bitbucket UI)?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

244 views 2 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you