0

I am automating the process to create Bitbucket repository using the Rest API( I am good with creating the empty repository)

I need to know, is there any provision to enable the HOOKS like JIRA Issue Commit checker and Webhook to Jenkins using the API/CLI.

2 Answers2

0

To Enable Webhook for notifying a configured endpoint of changes to this repository.

curl -u user -X PUT -H "Accept: application/json" -H "Content-Type: application/json" "https://${GITURL}/rest/api/1.0/projects/${ProjectName}/repos/${RepoName}/settings/hooks/com.nerdwin15.stash-stash-webhook-jenkins:jenkinsPostReceiveHook/enabled" -d "{"jenkinsBase": "https://localhost:8080/", "cloneType": "http"}"

0

JIRA Yet Another Commit Checker pre-receive hook.

curl -u user -X PUT -H "Accept: application/json" -H "Content-Type: application/json" "https://${GITURL}/rest/api/1.0/projects/${ProjectName}/repos/${RepoName}/settings/hooks/com.isroot.stash.plugin.yacc:yaccHook/enabled" -d '{"cloneType": "http", "requireJiraIssue": true, "commitMessageRegex": "CYVC-[0-9]+.*", "errorMessage.COMMIT_REGEX": "Please enter valid Jira Issue" }' --output ./Jira_Hook.json