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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.