Forums

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

Get the commit messages from bit bucket using the Bit bucket API

Naga Priyanka Chilamkurthi
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!
March 24, 2018

Hi Folks, We have a requirement to get the list of commit messages of a particular release branch  from the EDP-Bitbucket using the API and put it in a word document as a part of the Release Notes automation. Is there a way that i can generate the API key or suggest me how can i get these details. We are using powershell.  Please excuse me i am very new to automation and also the IT. 

1 answer

0 votes
Michael Walker
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 10, 2018

Hi Naga,

I'm happy to report that there is an API endpoint for exactly that. It will retrieve the commit details for you between 2 commit IDs allowing you to specify the start and end commits of a branch, thus retrieving only the commits from that branch. For example:

curl -u <admin_user> -v -X GET -H "Content-Type: application/json" "https://bitbucket.mycompany.com/rest/api/1.0/projects/{PROJECT_KEY}/repos/{REPOSITORY_SLUG}/commits?followRenames=false&ignoreMissing=false&since={START_COMMIT}&until={END_COMMIT}&merges=include&withCounts=true&limit=1000" | python -m json.tool

 As you stated that you are using PowerShell, ensuring that you install Git with Unix tools will allow you to utilize commands like curl used in the example above.

I hope this helps!

Best Regards,

Michael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events