is there any api that list out all the commits against a tag or against a sprint?

I want to list out all the jira commit from different projects under same workspace for a particular sprint. as of now I am maintaining a changedlog.md file to do so manually. is there any api available by which I can get list of all commits jira no for a tag? or a sprint? 

is there any api for git log?

1.if so how then whats the endpoint and payload and header

2. without access token how can I get that?(I have app password)

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 06, 2022

Hi @sourav karmakar and welcome to the community!

 

is there any api for git log?

There is an API endpoint that will return all commits of a repo (like git log)

If you have generated an app password for your Bitbucket account, you can use it with your Bitbucket username for authentication.
You can find your Bitbucket username here: https://bitbucket.org/account/settings/

An example with curl is the following:

curl -u BitbucketUsername:AppPassword https://api.bitbucket.org/2.0/repositories/WORKSPACE-ID/REPO-SLUG/commits

where
BitbucketUsername replace with your Bitbucket username
AppPassword replace with the app password you generated
WORKSPACE-ID replace with the workspace id where this repo belongs
REPO-SLUG replace with the repo slug for your repo

This API endpoint doesn't support filtering at the moment. Additionally, any Jira issue keys in the commit messages will be returned as part of the commit message, and not in a separate field. If you want to filter the results, my suggestion would be to use another tool that can filter JSON data to filter the results, like jq.

 

list out all the commits against a tag

Are you referring to Git tags (https://git-scm.com/book/en/v2/Git-Basics-Tagging) ?

If so, you can retrieve the commit associated with a tag with the following endpoint:

You can use filtering to get only the commit hash:

curl -u BitbucketUsername:AppPassword https://api.bitbucket.org/2.0/repositories/WORKSPACE-ID/REPO-SLUG/refs/tags/TAG-NAME?fields=target.hash

 

list out all the commits against a sprint?

I will check with my colleagues from Jira support if that is perhaps possible with Jira API, I will let you know as soon as I have an update.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events