Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Automation of ScriptRunner Pre-Receive Hooks Addition


Hey everyone,

I have been running into this problem, and I am not sure how to properly solve it.

I have created a Python script that uses the BitBucket Atlassian plugin to create repositories under a given project. I have finished this task.

However, under each repository, I want to automate the process of including a default pre-receive (protect git refs) hook in ScriptRunner. I am not sure what is the best way to go about it is.

Does anyone have any clues or pseudocode? I have tried doing POST calls that mimic the network transaction, but I am getting a 500 error. 


1 answer

0 votes
Robert Giddings _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 21, 2021

Hi @John Henry ,

Currently ScriptRunner for Bitbucket does not support automated creation of ScriptRunner Hooks.

This is something we are looking into providing support for in future.

In the meantime, I believe you have three options you could try:

1) Continue your experimenting with the POST calls you have been doing.

2) Are you aware of the Clone Repository Configuration Built-In Script ( as this could answer your requirement in a different way?

3) Are you aware that when setting up global Hooks (as a Bitbucket administrator) using ScriptRunner for Bitbucket you can set them to apply to all current and future projects and repositories. Thereby negating the need to include the default hook each time.

Please let me know if any of these options help you achieve what you want to achieve?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events