Forums

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

How can I programmatically enable/disable the "JIRA ID validator All Commits in a push" hook

Ed Hunziker July 12, 2018

Trying to figure out how to programmatically enable/disable the "JIRA ID validator All Commits in a push" hook feature on a BitBucket repository.

1 answer

0 votes
Julius Davies [bit-booster.com]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2018

What kind of programmatic rules are you thinking of setting up?

Are you an admin for that repo?  Or just a regular user?  If you're an admin take a look under "Repository --> Settings --> Hooks" as well as "Merge Checks" to see if there's anything in there you can adjust. 

There are several popular free and paid add-ons for enforcing git policy like this:   ScriptRunner (paid), Jira Hooks (paid), Commit Policy (paid), Yet Another Commit Checker (free), and Control Freak (free). 

In theory you *could* develop your own plugin to programmatically enable/disable JIRA checking rules to suit your specific needs, but in my own experience it's a lot of work!  (My company develops and maintains the free Control Freak add-on).

Ed Hunziker July 12, 2018

Have some rules enforced for users that we don't want the admins to have to abide with.  Have some remote automation that needs to be able to bypass those rules.  Just wondering if the BitBucket API would allow doing stuff like that via curl.

jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2018

Are you asking about Bitbucket Cloud or Bitbucket Server?

Ed Hunziker July 12, 2018

Server

Julius Davies [bit-booster.com]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2018

 

I just checked and ScriptRunner, Jira Hooks, Yet Another Commit Checkerand Control Freak all support some form of "skip checks if user = x" config.

(I can't be bothered to check Commit Policy because that add-on requires installation and config on both JIRA and Bitbucket --- too much work for me right now!)

Do you know if the "JIRA ID validator All Commits in a push" logic you're referencing comes from a particular add-on?  I am not familiar with Bitbucket Server offering anything like that out of the box.

Ed Hunziker July 12, 2018

It's configured with Jira plugins.  That's the plugin we're trying to end run.

Ed Hunziker July 12, 2018

Just trying to temporarily programatically disable that Jira hook.

Julius Davies [bit-booster.com]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2018

 

I'm pretty sure you can enable/disable a plugin through the REST API using sys admin credentials.  Note: that disables it site-wide (disabled for all repos across all nodes of your datacenter instance).

I suspect the "Universal Plugin Manager" API documents will help you get started on that course of action:  UPM REST API  

Like Amyn Bennamane likes this
Ed Hunziker July 12, 2018

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events