Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket REST API - two commits having same json data output - how to join them in SQL query

Ramakrishnan Srinivasan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2019

Hi,

 I am trying to get SQL query to work to map branches and tags. I have these two REST APIs to same Project and slug, giving same json output

.../bb/rest/api/1.0/projects/<PROJECT_X>/repos/<slug_y>/commits/71f5cc3eb287bad159abb68bd695b7972f706f8a

.../bb/rest/api/1.0/projects/<PROJECT_X>/repos/<slug_y>/commits/e784e7a9483594b72d200e15b77b56db61414526

The first one is a Merge commit (from GUI I figured out) and second one is the hash for the tag and I assume it is also a commit, I may be wrong here; for the second REST API call, public.sta_repo_push_ref table shows it as "to_hash" column value.

 

Both of them return same json data with first parameter 

{"id":"71f5cc3eb287bad159abb68bd695b7972f706f8a"....

I was trying to see how to join/map 71f5cc3eb287bad159abb68bd695b7972f706f8a and e784e7a9483594b72d200e15b77b56db61414526 in SQL query so that I can get the respective tag and branch mapped.

I took the data dump and tried searching these two hashes (or commits ??) but could not relate them. I am not sure how REST API call returns same json data and which SQL table stores their relation.

Our Bitbucket version is v5.15.0 and dB is Postgres 9.5

Can anyone please help me out on this?

Thank you

with warm regards

ramki

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events