youngmon/atlassian-qna huggingface dataset:
Someone has already added that SSH key.
Asked by Niklas Eliason:

I have a problem on one of our production servers where when I try to pull some of the repos I get the following error:

```
The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
```

but when I try to add the servers public key to Bitbucket I get this error instead:

```
Someone has already added that SSH key.
```

however I cannot find it in the list of accepted keys on bitbucket.

I know this key has worked before because I pulled this repo to the server just a couple of days ago. I do know my boss removed one of our team members recently, if that might have something to do with it.


Answers:
author: Caroline R
body: Hi, [@Niklas Eliason](/t5/user/viewprofilepage/user-id/4837304), welcome to the community!

As we will need to know the public ssh key to further investigate this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to share any questions if needed.

Kind regards,  
Caroline

comments: author: Niklas Eliason
body: Hello Caroline. I can't seem to find the link.


author: Caroline R
body: Hi, [@Niklas Eliason](/t5/user/viewprofilepage/user-id/4837304), this is the link to your ticket:

* <https://getsupport.atlassian.com/servicedesk/customer/portal/11/BBS-183175>

Make sure you access it with the same account you used to create this question.

Please let me know how it goes.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud
Bitbucket pipelines - REST API call to fetch pipeline runs after a given date
Asked by Peter Coppens:

Hello

I am trying to use the bitbucket REST API to retrieve pipeline builds after a given date  

Failed attempts...

```
https://api.bitbucket.org/2.0/repositories/myworkspace/myproject/pipelines/?created_on>2022-01-01T00:00:00Z'

https://api.bitbucket.org/2.0/repositories/myworkspace/myproject/pipelines/?q=created_on>2022-01-01T00:00:00Z'

https://api.bitbucket.org/2.0/repositories/myworkspace/myproject/pipelines/?created_on>"2022-01-01T00:00:00Z"'

https://api.bitbucket.org/2.0/repositories/myworkspace/myproject/pipelines/?q=created_on>"2022-01-01T00:00:00Z"'

...

```

<br />

<br />

Whatever I have tried, the results always start from the first pipeline run ever for the given project  

<br />

Could someone point me in the right direction?  

Tx!  

Peter


Answers:
author: Theodora Boudale
body: Hi Peter,

I'm afraid that the pipelines API endpoint doesn't support filtering at the moment.

We have a feature request about this in our issue tracker:

* <https://jira.atlassian.com/browse/BCLOUD-14000>

If you'd be interested in that, I would suggest adding your vote to the feature request (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

Until this is implemented, you could retrieve all pipelines via API and then use another tool that can filter JSON data, like jq, in order to filter the results.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

rest
Is there anything similar to Plan Branches for BitBucket Cloud/Pipelines?
Asked by Noel G:

In Server/DC version we have this nice feature we use a lot for some use cases.

Each time a developer creates a feature branch in BitBucket, a corresponding Build plan is automatically created in Bamboo feeding from the newly created branch.

The developer can then run a personal build with their feature branch code before integrating it with the team's work.

I cannot find any similar automation in BitBucket Cloud pipelines, at least out of the box.

Can anyone help please?

Thank you!


Answers:
author: Theodora Boudale
body: Hi [@Noel G](/t5/user/viewprofilepage/user-id/4613587) and welcome to the community!

One option is to use a default pipeline in your bitbucket-pipelines.yml file as follows

```
pipelines:
  default:
    - step: 
        script:
          - <command here>
    - step: 
        script:
          - <command here>
```

If you have such a configuration in the bitbucket-pipelines.yml file of the main branch of the repo, then every time someone creates a new branch out of the main one, this pipeline will run for that branch as well.

If you prefer to specify branch names in bitbucket-pipelines.yml or if the build running for the branches created out of the main one should be different, you can extend the branches definition to take into account these branches as well.

E.g. if your main branch is called *main* , and the branches the developers create out of main have the prefix *feature/*, then the bitbucket-pipelines.yml file could look as follows:

```
pipelines:
  branches:
    main:
      - step:
          script:
            - <command here>
    feature/*:
      - step: 
          script:
            - <a different command here>
```

Does either of these options work for you?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to get all branches from pipelines?
Asked by Mikhail Kopylov:

In bitbucket-pipelines.yml I have the following script:

\`git branch -a\`

When it's run on \`master\` branch, it shows only \`master\` and \`remotes/origin/master\`. When it's run on \`123\` branch, it shows only \`123\` and \`remotes/origin/123\`.

So it shows only current branch, but doesn't show all the repository branches.

I wonder, why?

Is there a way to get access to all the repository branches from git CLI?


Answers:
author: Norbert C
body: Hi Mikhail,

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

I'd like to inform you when you clone a repository with Bitbucket Pipelines, by default it only clones the branch where the Pipelines got initiated. This is due to make the build quicker as it doesn't need to clone all the branches.

In case you would like to clone the full repository with every repository, I would like to suggest you to use the following settings in your configuration. This way it'll clone every branch, but please keep in mind, that it'll make your build a bit slower:

```
clone: 
 depth: full
```

Please let me know how it goes.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Adrian Lapierre
body: ```
clone: 
 depth: full
```

fix the problem


author: Patrick Nelson
body: Users may also need to perform a "git checkout" as well if they want to get details about tags. I'm not sure why, but the following fails WITHOUT a checkout:

```
export TAG_INFO=`git branch --contains tags/$BITBUCKET_TAG 2>/dev/null`
```


Tags: bitbucket-cloud

cloud

git
Linking to pull requests not working
Asked by Khrisna Gunanasurya:

I coming from Github, and on Github, we can easily reference a pull request to another pull request by just writing #\<id\> in the PR description, but it's doesn't work on bitbucket, even though I can see that they have this feature in.

here <https://confluence.atlassian.com/bitbucketserver/markdown-syntax-guide-776639995.html#Markdownsyntaxguide-Linkingtopullrequests>

does someone have this issue as well?


Answers:
author: Norbert C
body: Hi Krishna,

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I'd like to inform you that this is actually possible, but not the way as the documentation shows. Please keep in mind, that the documentation you linked is a documentation for Bitbucket Server and Bitbucket Server and Bitbucket Cloud are two different products.

In case you wish to link Pull Request in the Description, please use the following syntax:

```
?PR #number
```

Please let me know if it helped you :).

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


Tags: bitbucket-cloud

cloud
I can't receive the bitbucket deposit invitation email
Asked by Mohamed.DJALOUD:

Hello,  
I can't receive the bitbucket deposit invitation email.  
The repository admins tried to invite me but it doesn't work.  
you can check if my e-mail has a block on the server.  
Thank you in advance!


Answers:
author: Andy Heinzer
body: Hi [@Mohamed.DJALOUD](/t5/user/viewprofilepage/user-id/4838371)

I found there was a bounced email in our system or your address:

```
550: 550 5.4.1 Recipient address rejected: Access denied. AS({hex}) [DB8EUR05FT017.eop-eur05.prod.protection.outlook.com]
```

I have cleared this entry from our system. So please try again. If this re-occurs, then you might need to reach out to your mail administrator to better understand why these errors keep happening.

Andy

comments: author: Mohamed.DJALOUD
body: [@Andy Heinzer](/t5/user/viewprofilepage/user-id/541137) thanks , it work


Tags: bitbucket-cloud

cloud
Invitation Problem
Asked by Rest Admin:

I can't get invitations from my team. They tried so many times to invite me but invitation mail was never received in my mailbox. How can I fix this ?


Answers:
author: Theodora Boudale
body: Hi [@Rest Admin](/t5/user/viewprofilepage/user-id/4838186) ,

Was the invitation sent to the same email as the one of your community account?

I checked in our system and this email is not in any of our suppression lists.

If the invitation was sent to a different email address of yours, could you please log in <https://community.atlassian.com/> with that email address, and leave a comment here? I will then be able to view the email of that account and check if it is in any of our suppression lists.

Kind regards,  
Theodora

comments: author: ?lker Tural
body: Hi,

This is my Atlassian account which is not getting invitation mail from Bitbucket.

Best Regards..


author: Theodora Boudale
body: Hi [@?lker Tural](/t5/user/viewprofilepage/user-id/4843934),

Thank you for your reply.

The email of this account was in one of our suppression lists. This usually occurs when we try to send an email and either the email account is not operational, or there is some problem with the email server of the recipient at that time, indicating permanent failure.

I went ahead and removed your email address from our suppression list.

Could you please ask your team to send you a new invitation now?

A new invitation needs to be sent, as the previous ones were dropped.

Please feel free to let me know how it goes.

Kind regards,  
Theodora


author: ?lker Tural
body: I finally got the invitation mail. Thank you for your support.

Best Regards...


author: Theodora Boudale
body: That's good to hear and you are very welcome.

Please feel free to reach out if you ever need anything else!

KInd regards,  
Theodora


Tags: bitbucket-cloud

cloud
Request for Garbage Collection
Asked by zachredfern:

Hello,

I have a repository reaching 4GB in space so I've run the BFG tool as recommended. As mentioned in [this](https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/) article, I've attempted to trigger automatic clean up, but have been unsuccessful.

Firstly, does automatic garbage collection only run when the repository's size *exceeds* the 4GB hard limit?

Secondly, are any support staff available to run garbage collection to reduce the size of the repository?

Thanks for your time,

Zach


Answers:
author: Theodora Boudale
body: Hi Zach,

The automated garbage collection will only run when all of the following is true:  
1. The repo is over the 4GB limit  
2. You undo the last push as per <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Undoing-the-last-push>  
3. The feature **Delete dangling commits when over size limit** is enabled in <https://bitbucket.org/account/settings/features/> for the account that does the push

Cleaning up the repo with BFG will not trigger it.

I see that your Bitbucket account has access to several workspaces and repos. Could you please let me know the last 2 letters of the repo name and also of the workspace that owns it, so I can identify it and run a git gc on it?

Kind regards,  
Theodora

comments: author: zachredfern
body: Hey Theodora,  

Thanks for listing the criteria, I'll keep that in mind going forward.   

The workspace is \<workspace-id-removed\> and the repository name ends in "o1."  

I appreciate the help,

Zach


author: Theodora Boudale
body: Hi Zach,

Of course, I ran a git gc on the repo and its size is 95.8 MB now. Does this agree with the size of your local repo, after history rewrite?

Just a heads up, I removed the workspace id from your post to protect your privacy.

Kind regards,  
Theodora


author: zachredfern
body: Hi Theodora,

The size certainly does look accurate. I believe all is in good order now.

Thanks again,

Zach


author: Theodora Boudale
body: Hi Zach,

Thank you for the confirmation and you are very welcome, I'm glad to have helped.

Please feel free to reach out if you ever need anything else!

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

garbage-collection

repository
Required Build settings for Teamcity
Asked by devo666:

I want to set up my bitbucket PRs to only be able to be merged when a certain build completes on my teamcity build server. There is a "Required Builds" option on the repo but I don't know what value to put into the "Add Builds" section of the form. The documentation says:

Add any build keys here that will need to successfully pass before merging a pull request. The build key will depend on the CI tool used to generate the build.

But I don't know what the build key is for a build in teamcity. I tried the name and the id but neither work.


Answers:
author: Andy Nguyen
body: Hello, I was able to figure this out by using \`buildTypeId\` URL param value from the TeamCity build URL. You can grab the TeamCity build URL from a Pull Request's build tab.

```
/viewLog.html?buildId=0000&buildTypeId=<use this value for the build name>
```


author: Arthur Senko
body: Hi there, have you managed to resolve this issue? I have exactly the same question..

comments: author: Arthur Senko
body: Have just found a workaround: you can just configure "Commit status publisher" build feature in TC and then just set "minimum successful builds" in "merge-checks" section in Bitbucket.


Tags: bitbucket-server

server
Not receiving invitation email
Asked by Brayan Roa:

Hello,

I cannot receive the invitation email to a bitbucket.org repository. The repository admins have tried to send me the email several times and I still do not receive it in my Gmail address inbox (they are not my "Junk email" folder either), while other work mates have been able to get it.

Can you please help me?

Thanks in advance!


Answers:
author: Andy Heinzer
body: Hi [@Brayan Roa](/t5/user/viewprofilepage/user-id/4837864)

It appears that you created a support case for this. Our team has investigated this and found your address was on a suppression list over in <https://getsupport.atlassian.com/servicedesk/customer/portal/11/BBS-183102>

This appears to have been removed at this time, so you should request that your admin resend the invitation now. It should allow it to come through now.

Andy


Tags: new-to-atlassian
Avoiding asking passphrase when pushing
Asked by Shyam:

Hi Team,

Please help me how to avoid passphrase asking when I tried to push

*** ** * ** ***

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/189859iB32645258BD58C51/image-size/large?v=v2&px=999 "Capture.PNG")


Answers:
author: Caroline R
body: Hi, [@Shyam](/t5/user/viewprofilepage/user-id/4756005),

I saw that you created a ticket with our support related to the same question and they have already answered you, so to avoid any possible misunderstandings or miscommunication that may arise from discussing the same matter on two different platforms, let's focus on the ticket instead.

Once the ticket is resolved, feel free to share the resolution here to help other community members that may have the same issue.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
How to count parallel test steps under a parallel block in bitbucket yml?
Asked by Xiao Li:

I'd like to use the value of BITBUCKET_PARALLEL_STEP, and BITBUCKET_PARALLEL_STEP_COUNT to figure out how many tests each parallel step should run together with the filter flag of jest.

The challenge I have is that for default pull request "\*\*", I have 3 other parallel steps. For pull requests starting with release/\* I need to run 2 other parallel steps. As a result, trying to figure out how many total parallel steps there are for running tests get a bit tricky inside the steps.

<br />

What I want to do

pull-requests:  
"\*\*":  
- variable:  
NOT_TEST_STEP_COUNT: 2  
- parallel:  
...2 none test step  
- step: \*Test_1  
- step: \*Test_2  
...40 other steps

"release/\*":  
- variable:  
NOT_TEST_STEP_COUNT: 3  
- parallel:  
...3 none test step  
- step: \*Test_1  
- step: \*Test_2  
...40 other steps

Inside test steps, I use npm with a filter file to decide how many tests to run dynamically inside test steps as I might increase test steps to reduce time it takes to run all 3000 tests we have.

I pushed this code up and bitbucket pipeline complains it's not valid. Can't I use variable here?

I then thought of using nested parellel, but the validator doesn't like it either.

- parellel:  
- parallel:  
- step  
- parallel:  
- step

Apart from adding a sequential step that generates a file that I can source in later steps, is there a simple way to count total number of test steps inside a step in my use case?


Answers:
author: Xiao Li
body: I ended up moving all test steps to the top of the parallel group and export a TEST_STEP_COUNT variable instead. This way, my jest filter assumes test steps begin at index 0 within the parallel group, and knows the total test step count from the environment variable I exported.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

devops
Stopped receiving email notifications for bitbucket
Asked by Prabhjot Kaur:

Since last week I am not receiving bitbucket emails


Answers:
author: Caroline R
body: Hi, [@Prabhjot Kaur](/t5/user/viewprofilepage/user-id/4837351), welcome to the community!

I checked our logs and confirmed that your email had a block on the server that prevented emails from being sent to you. So I removed your email from this suppression list.

Could you please confirm if you receive Bitbucket emails now?

Kind regards,   
Caroline

comments: author: Prabhjot Kaur
body: Thanks Caroline! I am receiving bitbucket emails now, suddenly a lot of them lolz.


author: Prabhjot Kaur
body: [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) It happened again, I stopped receiving the emails. Is there any permanent solution to this problem?


author: Andrew Macpherson
body: Hi [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) I am a co-worker of [@Prabhjot Kaur](/t5/user/viewprofilepage/user-id/4837351) and am experiencing the same issue. I know of at least one other member of our team that is also having this problem. Any suggestions for getting this permanently resolved would be great.


author: Caroline R
body: Hi, [@Andrew Macpherson](/t5/user/viewprofilepage/user-id/4851648) and [@Prabhjot Kaur](/t5/user/viewprofilepage/user-id/4837351),

I checked your domain and confirmed that some emails were in a suppression list with the following message:

```
550: 550 Mailbox does not exist!
```

I have removed all of them from this list, but in case you face this problem again, I suggest that you create a ticket with us so we can further investigate what is causing this issue. In order to do that, you can access [https://support.atlassian.com/contact](https://support.atlassian.com/contact/#/), in "What can we help you with?" select "**Technical issues and bugs** " and **Bitbucket Cloud** as the product. Then, select **Yes** under the "Are you having an issue with Bitbucket workspace invitations?" option.

Please feel free to share any additional questions or concerns regarding this case.

Kind regards,   
Caroline


author: Andrew Macpherson
body: Hi Caroline, the issue is happening again for me. I have opened a support ticket but wanted to tag you here as well in case there is anything you can do.

Thanks.


author: Theodora Boudale
body: Hi Andrew,

Please allow me to step in as Caroline is out of office.

Your email was in one of our suppression lists, so I went ahead and removed it.

If this keeps happening regularly, I would suggest talking with the administrator of your mail server and asking them to investigate if there is an issue with your mail server.

The reason why an email address ends up in our suppression list is that we attempt to send an email to it, and receive a hard bounce response from the recipient's mail server which indicates permanent failure. In your case, the error we received was:

```
550: 550 Mailbox does not exist!
```

It might be an outage with your mail server or some other configuration issue that results in these hard bounce events.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Getting branches from a repository via bitbucket Rest API
Asked by Bernardo Garc?a:

Hello, community.

I am looking for the list of endpoints available for bitbucket API regarding get the branches from a repository and a specific branch.

I was expecting to see something like:

```
GET /2.0/repositories/{workspace}/{repo_slug}/branches/

GET /2.0/repositories/{workspace}/{repo_slug}/branches/{branch}
```

So I can get the commits from a specific branch.

I know [I can get commits](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commits-get) but with this endpoint, its scope is under repository perspective.

Do you know if there are endpoints to work with branches and recursively into its hierarchy?  
I looked over the [documentation](https://developer.atlassian.com/cloud/bitbucket/rest/intro/) but I did not see what I was looking for so that is why I am posting this question here.  

In addition, I see some time ago that was not possible according to [this](https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-Server-API-to-get-information-of-all-the-branches-in-a/qaq-p/958227) question. Is it still true?   


Answers:
author: Bernardo Garc?a
body: When hitting [this endpoint](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get):

```
https://api.bitbucket.org/2.0/repositories/<workspace>/<repository-name>`
# GET /2.0/repositories/{workspace}/{repo_slug}
```

You get as a result a JSON document. In the \`*links* \` attribute you got a key called \`*branches*\`. It is something like this:

```

{
"scm": "git",
"has_wiki": false,
? ? ? "links": {
? ? ? "watchers": {
? ? ? ? ? ? "href": "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/watchers"
? ? ? },
? ? ? "branches": {
? ? ? "href":? ? ? ?"https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/refs/branches"
},
....
```

So you can hit the endpoint and get the branches:

```

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/refs/branches
# GET /2.0/repositories/{workspace}/{repo_slug}/refs/branches

```

And get a specific branch with

```

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/refs/branches/<branch-name>
# GET /2.0/repositories/{workspace}/{repo_slug}/refs/branches/<branch-name>
```


Tags: bitbucket-cloud

cloud

rest-api