Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Atlassian Python API - how to retrieve commit associated with a build ?

 

We are a Atlassian Shop. We use Bamboo, Bitbucket, Confluence and Jira. I am trying to find out which commit/commits are associated with particular build.

 

I am trying to find out what Bitbucket commit is associated with my Bamboo Build.

 

http://<base url>/rest/api/latest/result/<build key>

 

It retrieves information minus commit. I see the commit information through the GUI.

Is there an API that can retrieve the commit information ?

thanks

 

 

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 10, 2022

Hello @Naren

Welcome to Atlassian Community!

To find the associated revision (commit/PR) for a nominated build you can use the following API syntax:

/result/{projectKey}-{buildKey}-{buildNumber : ([0-9]+)|(latest)}?expand&favourite&start-index&max-results

Then look for the value of "vcsRevisionKey".

https://docs.atlassian.com/atlassian-bamboo/REST/8.1.3/#d2e4105

For example, considering my project is ABC, the plan is NOP and Build is 31:

$ curl -k -s -u admin:admin -X GET -H "Accept: application/json" https://bamboo.mydomain.net/rest/api/latest/result/ABC-NOP-31 | jq -r ".vcsRevisionKey"
2c357d05bac57c09bdc588f5380d8fff25bf8693

 

Regards,

Eduardo Alvarenga
Atlassian Support APAC

Thanks Eduardo

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 11, 2022

Hey @Naren please let us know if we can go ahead and close this thread by accepting this answer as a solution for this case.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events