You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
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 (https://docs.adaptavist.com/sr4bib/latest/features/built-in-scripts/clone-repository-configuration) 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?
Product Manager, ScriptRunner for Bitbucket