Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Setup Jira automation rule

DEENA DHAYALAN M J
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2024

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.

 

 

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
November 22, 2024

Update on 12 Jun 2025

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.

bitbucket-cloud-policy-configuration.png

Original response

@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.

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events