Forums

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

SQL query help needed: List all commits from page commits

Andrey Rezvushkin August 13, 2018

Hello!

 

I need you help!

I want to get all commits from page commits. I used different variations, but it does not work out. 

Can you help me, pleeease?

 

5 answers

0 votes
Andrey Rezvushkin August 23, 2018

@Ana Retamal can you help me?

0 votes
Andrey Rezvushkin August 15, 2018

up!

0 votes
Andrey Rezvushkin August 13, 2018

On Rest API: How can i join all without pull_request_id ? 

0 votes
Andrey Rezvushkin August 13, 2018

My sql request:

select p.project_key, r.slug, pr.ref_id, pr.change_type, pr.from_hash, pr.to_hash, nu.name, pr.activity_id, r.id "r_id",
prra.activity_id "prra_activity_id", prra.from_hash "prra_from_hash", prra.to_hash "prra_to_hash", prra.prev_from_hash "prra_from_prev_hash", prra.prev_to_hash "prra_to_prev_hash", prra.commits_added, prra.commits_removed,
prrc.activity_Id "prrc_activity_id", prrc.changeset_id, prrc.action,
pra.activity_Id "pra_activity_Id", pra.pr_id "pra_pr_id", pra.pr_action "pra_pr_action",
pur.id, pur.entity_version, pur.scoped_id, pr_state, pur.from_repository_id, pur.to_repository_id, pur.from_branch_fqn, pur.to_branch_fqn, pur.from_branch_name, pur.to_branch_name
from public.sta_repo_push_ref pr
left join public.sta_repo_activity ra on ra.activity_id = pr.activity_id
left join public.repository r on r.id = ra.repository_id
left join public.project p on p.id = r.project_id
left join public.sta_activity a on a.id = pr.activity_id
left join public.sta_normal_user nu on nu.user_id = a.user_id
left join public.sta_pr_rescope_activity prra ON pr.to_hash = prra.from_hash
left join public.sta_pr_rescope_commit prrc ON prra.activity_id = prrc.activity_id
left join public.sta_pr_activity pra ON prrc.activity_id = pra.activity_id
left join public.sta_pull_request pur ON pur.id = pra.pr_id
where pr.ref_id like '%feature/DEV-1%'
and result:
project_key slug ref_id change_type from_hash to_hash name activity_id r_id prra_activity_id prra_from_hash prra_to_hash prra_from_prev_hash prra_to_prev_hash commits_added commits_removed prrc_activity_id changeset_id action pra_activity_Id pra_pr_id pra_pr_action id entity_version scoped_id pr_state from_repository_id to_repository_id from_branch_fqn to_branch_fqn from_branch_name to_branch_name

PROJ slug feature/DEV-1 1 0 221a3e13e1e1c93ee5f87633d37dawdawddawd user 1872044 1272 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
PROJ slug feature/DEV-1 3 221a3e13e1e1c93ee5f87633d37dawdawddawd 9c1434c17bcca8f767b40ecb49dawdawdawdaw user 1881002 1272 1881003 9c1434c17bcca8f767b40ecb49dawdawdawdaw cfb73ac9bc92cd362d81adawdawdadawdadaw 221a3e13e1e1c93ee5f87633d37dawdawddawd cfb73ac9bc92cd362d81adawdawdadawdadaw 1 0 1881003 9c1434c17bcca8f767b40ecb4927e25518c4d5a6 0 1881003 123894 5 123894 41 2734 2 1272 1272 refs/heads/feature/DEV-1 refs/heads/mast feature/DEV-1 mast

first line is almost empty.. i don't know, through what join it.?!

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2018

Hi Andrey, we need more info: are you using Bitbucket Server or Cloud? 

Would the REST API suit you? Have you checked our documentation for Server and Cloud?

Kind regards,

Ana

Andrey Rezvushkin August 13, 2018

Hi Ana!

We are using Bitbucket Server. It is preferable to work with the database.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events