I want to setup if any user commit the code to bitbucket,first check that respective jira ticket status is inprogress then only allow to commit,if not in progress not reject the commit ,how to setup this using jira automation,anyone please guide me.
In the meanwhile we completed the first version of the app, therefore 🎉 Better Commit Policy Connector has been released for Bitbucket Cloud!
Install it here and see the documentation here.
@DEENA DHAYALAN M J We have an app that does exactly what you look for! It has been developed for many years and used by several teams in regulated industries.
See: Better Commit Policy for Bitbucket
Note that right now, it is available only for Data Center (and for Server), but we are already working on the Cloud version! I wrote a reminder for myself to update this topic when the Cloud version is out.
Hi Deena and welcome to the community!
I'm afraid that this cannot be achieved with Jira automation rules. An automation rule with trigger Commit created runs when a new commit is created in the repo. Once a commit is added to the repo, you cannot reject it. The only way to undo it is to run a git reset command in a clone of the repo and then force push this change to the Bitbucket repo.
You may be able to achieve this with webhooks, but please keep in mind that this is a risky operation. Both git reset and git push with --force are destructive operations. Such an implementation may end up removing commits that you actually want in the repo, so I would not recommend it.
We have a feature request for server-side pre-receive Git hook, which, if implemented, would allow you to reject commits based on certain conditions:
You can add your vote to that ticket and add a comment with your use case for our products managers to consider.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.