In our project we have multiple repositories. I want to generate a report for each user on how many commits he has done in a specific date range. We want to consolidate user's contributions(code commits, pull requests worked on, issues worked on etc) for each user in specified date range.
Is there any API that can help for this purpose.
Thanks
Hi @TS, Jeevitha and and welcome to the community!
We have APIs available for commits, pull requests, and issues (if you're talking about a Bitbucket issue tracker).
Please keep in mind that the commits API endpoint doesn't support filtering. You can retrieve all commits via API, and then use another tool that filters the JSON data in order to filter the results according to the commit author's email and time frame.
We have several API endpoints related to pull requests:
You can see a list of the available endpoints on the left sidebar on this page, for easier navigation.
If you're using Bitbucket's built-in issue tracker, we have API endpoints for that as well:
If you'd be interested in using a third-party add-on, you can check all available Bitbucket Cloud apps on Atlassian marketplace here:
Please feel free to reach out if you have any questions.
Kind regards,
Theodora
Hi @Theodora Boudale , Thanks you for the response.
But, I wanted to know at the user level. As we have more than 20k repositories, I do not want to iterate over all the repositories to find user commits nor I do not want to pass repo_slug as the user might have commits in multiple repositories.
I wanted to know the user contributions across all the repos in a specific date range. Even if the user has made commits in different branches under any of the repos that needs to be given in the response
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @TS, Jeevitha,
There is no API endpoint to get the commits of a user. Commits can be retrieved on a repository basis only.
That being said, can you please confirm if you are using Bitbucket Cloud or Bitbucket Data Center? I see that your question has the tag 'bitbucket-cloud', but I just noticed that your Bitbucket Cloud account doesn't have access to any repos. If you are unsure which one you use, the URL of a Bitbucket Cloud repo on your browser starts with https://bitbucket.org/, while Bitbucket Data Center repos have a different custom URL.
The reason I am asking is because Bitbucket Cloud and Bitbucket Data center are essentially two different products, and the APIs for each product are different. The APIs I provided in my previous answer are for Bitbucket Cloud, while Bitbucket Data Center APIs can be found here:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.