Vinodh C
Vinodh C

Reputation: 11

Get the commit comments for a particular branch in stash REST API

My repo is profitmanagement and my branch is release/17.4.0.Apr17, I want to find all the commits and the comments provided during commit for the specific branch.

What is the rest API to use to get this info?

Upvotes: 1

Views: 386

Answers (1)

Yogiraj
Yogiraj

Reputation: 328

You can use following REST API endpoint provided by Stash:

{your-stash-url}/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits

To find commits on a specific branch, use 'until' request query parameter - e.g.:

{your-stash-url}/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits?until=refs/heads/{branch-name}

Commit message corresponding to each message can be retrieved from the JSON response returned by the REST API.

The documentation is on: https://docs.atlassian.com/DAC/rest/stash/3.11.6/stash-rest.html#idp2461680

Upvotes: 1

Related Questions