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
Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...
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