Forums

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

Disable a bitbucket hook using REST-API

Pete75 October 29, 2019

Hi,

I have "Yet Another Commit Checker" Plugin installed and I can enable configured hook using REST-API like this:

curl -k --user user:passwd -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -X PUT https://bitbucket_url.com/rest/api/1.0/projects/my_project/repos/demo/settings/hooks/com.isroot.stash.plugin.yacc:yaccHook/enabled

After that I can see the hook is enabled:

curl -u user:passwd https://bitbucket_url.com/rest/api/1.0/projects/my_project/repos/demo/settings/hooks/com.isroot.stash.plugin.yacc:yaccHook
{"details":{"key":"com.isroot.stash.plugin.yacc:yaccHook","name":"Yet Another Commit Checker","type":"PRE_RECEIVE","description":"Yet Another Commit Checker pre-receive hook.","version":"1.24","configFormKey":"com.isroot.stash.plugin.yacc:yaccHook-config-form","scopeTypes":["PROJECT","REPOSITORY"]},"enabled":true,"configured":true,"scope":{"type":"REPOSITORY","resourceId":842}}

 

But how can I disable that hook via REST-API? I'm a bit confused :)

2 answers

0 votes
Jonny Boman
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!
October 15, 2020

You use:
curl -k --user user:passwd -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE https://bitbucket_url.com/rest/api/1.0/projects/my_project/repos/demo/settings/hooks/com.isroot.stash.plugin.yacc:yaccHook/enabled

0 votes
Carlos Flor
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!
August 3, 2020

Do you have news ?

 

i've the same question.

Jonny Boman
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!
October 15, 2020

See my reply...

Like GDC PDS SCM likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events