Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

REST API details for Bitbucket for precooks

Hi,

Could you please help me on getting the REST API details for listing the prehooks on Bitbucket

6 comments

Typo

REST API details for Bitbucket for listing Pre-receive hooks

This is on Bitbucket server 

Hi Team,

 

I was able to list down the repository hooks using the below API

https://$bitbucketInstance/rest/api/1.0/projects/{$bitbucketProject}/repos/{$repository}/settings/hooks/

 

Same way i was looking for REST APIs which will list down the pre-recevie hooks (prehooks)

For example ,

In Script Pre hooks section I have a pre receive hook called `Require  commits to be associated with a JIRA issue`

Using the pre hook API , I would like to fetch the form values under EDIT section of Require  commits to be associated with a JIRA issue.

Let us say I want to get the value of `JQL Clause template`

Please help me on this using Bitbucket REST API. Thanks in advance 

 

Thanks

Yatheesh

 

 

Thanks

Yatheesh

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 17, 2018

Hi @Yatheesh Rai,

Are you using an add on for the "Require  commits to be associated with a JIRA issue"? Maybe the Merge Checks one?

 

If that's the case, the add on itself would need to expose the REST API endpoint to retrieve those details.

 

Did you already try checking if any endpoint is listed in the REST API Browser?

Note: this is an additional add on that will need to be installed.

 

Cheers,

Caterina - Atlassian

Hi Caterina,

 

Are you using an add on for the "Require  commits to be associated with a JIRA issue"? Maybe the Merge Checks one?

Yatheesh: yes right 

I have already configured with Require  commits to be associated with a JIRA issue as pre-hook.I would like to get the JQL Clause template detail from this pre-hook using REST API.

Can you guide me on how the  add on itself   will expose the REST API endpoint to retrieve those details.Can you share the API details for the same

 

I have not tried REST API Browser, and it is unsupported by Atlassian.

 

Thanks

Yatheesh

 

 

And the Script pre - hook- Require  commits to be associated with a JIRA issue was enabled using the add-on - "Adaptavist ScriptRunner for Bitbucket Server"

After adding this add-on we see the option such as Script Pre hooks, Script post hooks, Script Merge hooks, Script Event handlers for each of the repositories 

 

I am intersted in listing out the Script Pre hooks ie,, the detail for  `Require  commits to be associated with a JIRA issue` using REST

Please provide REST API details for reading the data for

https://Bitbucketinstance/plugins/servlet/scriptrunner/builtin?section=prehooks&project=ProjectKey&repos=Reposlug#com.onresolve.scriptrunner.canned.bitbucket.hooks.RequireValidJiraIssue

Script Pre Hooks --> Require commits to be associated with a JIRA issue --> EDIT --> JQL clause template

Even I am interested to know this.

Comment

Log in or Sign up to comment