Hi,
I am trying to get the list of commits and line of codes changed by per user in bitbucket cloud.
I tried using api's
step followed for API :
- Generated Oauth token using endpoint
Then I followed this document : https://atlassian-python-api.readthedocs.io/index.html
In this the bitbucket cloud part is not much helping.
How we can use this localhost parts in bitbucket cloud which will also be helpful.
how we can create a bitbucket cloud client so we can use below method?
# Get pull request commits bitbucket.get_pull_requests_commits(project, repository, pull_request_id)
Please help me here how we can achive this?
Is there any bitbucket cloud app(marketplace) which can also help me here.
Hello @Yusuf Khan and welcome to the community!
In order to authenticate the API call using an access token, you will need to provide the access token in a Header named Authorization, where the value should be the word Bearer followed by the access token itself.
Below is an example of a request to List all the commits in a repository, including the access token in the request :
curl --request GET --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits' --header 'Authorization: Bearer <access_token>' --header 'Accept: application/json'
To get the access token used in the authentication, you will first need to call the below endpoint, providing the Key (clientId) and Secret (clientSecret) of the bitbucket OAuth consumer :
curl -X POST -u "ClientID:ClientSecret" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
The token is only valid for 2 hours, so after it expires you will need to get a new access token by calling the API endpoint above again.
As for your question about apps that can help build those reports, you can check the available Reports apps using the following link :
Thank you, @Yusuf Khan !
Patrik S
Hi @Patrik S ,
Thanks for your help about api.
The reporting apps you suggested. In those, is there any way to export that data in CSV, particularly commits data.
I have tried to use awesome graphs app but bitbucket cloud version of this app does not have any option to export data.
Please help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Yusuf Khan ,
Those apps are developed and maintained by third parties, so I would suggest reaching out to the app's vendor by opening the app on the marketplace and clicking on the Support option.
Thank you, @Yusuf Khan !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.