Missed Team ’24? Catch up on announcements here.

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

Get Fork Parent using API

jamiebaggott
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2019

I am trying to use the BitBucket Cloud API to get information about the repository that a given repository was forked from, but I cannot see a way to do this. Could someone please let me know if this is possible and, if so, how to do it? Thanks in advance for your help.

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 14, 2019

Hello @jamiebaggott,

Thanks for reaching out.

This information is returned in parent JSON element of the payload of /2.0/repositories/<account>/<repository> endpoint.

Note that you can use fields parameter to filter down response to only the fields you need, for instance:

https://api.bitbucket.org/2.0/repositories/dpenkin/atlaskit-fork?fields=name,full_name,uuid,parent.name,parent.full_name,parent.uuid

{
full_name: "dpenkin/atlaskit-fork",
uuid: "{4437c670-7948-40fa-b3ee-82cc47cf8654}",
parent: {
uuid: "{6380b4e9-6ac5-4dd4-a8e0-65f09cabe4c8}",
full_name: "atlassian/atlaskit-mk-2",
name: "Atlaskit-MK-2"
},
name: "Atlaskit-Fork"
}

Hope this helps.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events