youngmon/atlassian-qna huggingface dataset:
How to list ALL open Pull Requests via API?
Asked by Dave Lewthwaite:

What is the best way of listing ALL open Pull Requests using the REST v2.0 API?

It seems that you can only do this by iterating through users/projects/repos rather than a single operation to return a list across the whole account.

This looks like it was possible using the old v1.0 API, but this has long since been deprecated.

It is also possible via the UI dashboard - indeed that is this page <https://bitbucket.org/dashboard/pullrequests?section=all>

Our use case is to process this list and then forward reminders on to users in our Org that they have either a PR open that has been approved and need merging, or a PR that needs reviewing.

This seems like an omission in the API?


Answers:
author: Norbert C
body: Hi Dave,

Let me step in, I'm Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

I'd like to inform you that the functionality you're looking for is unfortunately not available yet. We have a feature request for this:

[BCLOUD-11980 API: Show Pull Requests for All Repositories](https://jira.atlassian.com/browse/BCLOUD-11980)  

Our development team will give a first-hand update on that ticket if there's any progress made so I would suggest keeping a watch and vote for it.

Do note however that there's no ETA on enhancement request, and all enhancements are implemented with this policy in mind: [Implementation of New Features Policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html)

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Dave Lewthwaite
body: Ok Great, thanks - I have voted for that issue.

In the meantime the most efficient model i've found is to iterate by User (we have many more repos than Users) and query for any open PRs they have.


author: Dave Lewthwaite
body: To follow up on this, it seems that iterating through repos rapidly hits the API rate limits - this is exactly why a combined API call makes more sense.


author: Fabio Racobaldo _Herzum_
body: Hi [@Dave Lewthwaite](/t5/user/viewprofilepage/user-id/981248) ,

there's a specific REST API in order to retrieve all pull request for a user <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-pullrequests-selected-user-get>

Hope this helps,

Fabio

comments: author: Dave Lewthwaite
body: Sorry, that still requires listing users and then iterating through every user, it's not really any better than iterating through every repo.


author: Fabio Racobaldo _Herzum_
body: Sorry [@Dave Lewthwaite](/t5/user/viewprofilepage/user-id/981248) , I missed part of your request. I confirm that your follow up is correct.


Tags: bitbucket-cloud

cloud
Is my private repository exposed?
Asked by willking101:

Hello,

Our client received an email today from a security company stating that we have a serious security issue. As proof that the vulnerability is valid they included a valid tree and parent ID / commit ID as well as the author name and email from our private Bitbucket repository.

I double checked that our repository is indeed set to private. I spoke with the hosting company to confirm they do not see anything malicious on their end. If I try to view the /.git folder by directly typing it in the url I receive a 404 error.

My question is, how were they able to obtain those details from our private Bitbucket repository and what should I do to ensure our repository and website are secure?

Thanks!


Answers:
author: Caroline R
body: Hi, [@willking101](/t5/user/viewprofilepage/user-id/2184503), thank you for reaching out to Atlassian Community.

As we'll need to know the workspace ID and repository name 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 let me know if you have any questions.

Kind regards,   
Caroline

comments: author: Jack
body: I have this exact same problem. What was the resolution for this?


Tags: cloud
I am not receiving bitbucket email notifications when someone mentions me
Asked by Conor Croke:

I am not receiving bitbucket email notifications when someone mentions me but am receiving other notifications. I have this checked in my notification settings.


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

I confirmed your email is not blocked, so this is not the reason you are not receiving these notifications. You mentioned you have this option checked in your notification settings, could you please confirm if you are referring to the "Someone mentioning me" option in your [personal settings](https://bitbucket.org/account/settings/notifications/)?

Also, the notifications you are receiving are related to the same repository?

Looking forward to hearing from you.

Kind regards,   
Caroline

comments: author: Conor Croke
body: Hi Caroline, yes I can confirm that "Someone mentioning me" is checked in my personal settings. Yes they would be related to someone mentioning me in a Pull Request in the comment sections. I do not receive an email or even a notification.


author: Caroline R
body: Hi, Conor, thanks for your confirmation.

Checking our logs, I don't see any non-delivered emails, so I would like to ask you to check your spam folder or if you have certain rules that make emails skip the inbox. Is anyone else having this problem or is it just your email? Could you please confirm when you start facing this issue?

Please feel free to share any additional information regarding this subject.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud
Can't pull an repository
Asked by HPCApps:

I've been using Bitbucket for a few years without any problem. Today, when I try to pull from any repository it asks me to log in and then rejects my credentials. I have tried setting up new credentials but they are also rejected when I try to use them.

I can still look at all the respositories through my web browser, I just can't pull anything.


Answers:
author: Jeff Thomas
body: You should create an App Password and update the password you're using for the Git operations - <https://bitbucket.org/account/settings/app-passwords/>

As of March 1, 2022, you can no longer use your account password for Git authentication. This is explained in more detail in <https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>


author: Jakub Smatana
body: I have encountered the same problem!

EDIT: You can read about it in this [issue](https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-Cloud-recently-stopped-supporting-account-passwords/qaq-p/1966221) .


author: felipesmendes
body: Same problem here!
Report for build minutes statistics at Bitbucket per month
Asked by Juhaina Almama:

Hi

We need functionality in Bitbucket on how to view total minutes spent per month

Any tips?

Thanks


Answers:
author: Mark C
body: Hi [@Juhaina Almama](/t5/user/viewprofilepage/user-id/3572503)

Thank you for reaching out to the community.

Unfortunately, Bitbucket Pipelines doesn't have the functionality to view Pipelines build minutes that can be filtered.  
We do have an existing feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-13637>  
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.  
![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

As a workaround, you can use this [Pipelines pipes script](https://bitbucket.org/atlassian/bitbucket-build-statistics/src/master/) that allows you to get Pipelines build minutes usage.

Here's an example to "*Get Pipeline details for last 10 days for all repositories in the workspace this Pipe is running*":

```
script:  script:    - pipe: atlassian/bitbucket-build-statistics:1.0.0      variables:        BITBUCKET_USERNAME: $BITBUCKET_USERNAME        BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD        BUILD_DAYS: 10
```

Hope it helps and let me know if you have further questions that I can help with.

Regards,  
Mark C


Tags: bitbucket-cloud

build

cloud

statistic
I'm create s3 by using pipeline but some issue please suggest me proper way
Asked by Ayush Sharma:

pipelines:  
branches: # Branch-specific pipelines definitions  
master:  
- step:  
name: Build and test the app  
image: node:latest  
script:  
- npm install  
- npm run test  
- npm run build  
production:  
- step:  
name: Building the app  
image: node:latest  
script:  
- npm install  
- npm run build  
artifacts:  
- build/\*\*  
- step:  
name: Deploying the app to S3  
deployment: production  
script:  
- pipe: atlassian/aws-s3-deploy:0.2.4  
variables:  
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID  
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY  
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION  
CREATE_S3_BUCKET: "myreact-s3"  
ACL: "public-read"  
LOCAL_PATH: "build"  
I use this file  


Answers:
author: Mark C
body: Hi [@Ayush Sharma](/t5/user/viewprofilepage/user-id/4764383)

Thank you for reaching out to the community.

Unfortunately, the [aws-s3-deploy](https://bitbucket.org/atlassian/aws-s3-deploy/src/master/) doesn't offer to create an S3 bucket. It is only for deploying your repository data to your created S3 bucket.  
If you'd like to create an S3 bucket on Pipelines, you can do it by using AWS CLI.  
Here's an example I've found that might help: [Create an AWS S3 Bucket using AWS CLI](https://medium.com/@vishal.sharma./create-an-aws-s3-bucket-using-aws-cli-5a19bc1fda79)

Hope it helps and let me know if you have further questions.

Regards,  
Mark C

comments: author: Ayush Sharma
body: thank you [@Mark C](/t5/user/viewprofilepage/user-id/1210823)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Access issue through API from postman using username and token.
Asked by mahesh_brillio:

The problem is-

By mistake- I was trying Email and Personal token as Basic authentication in Postman. I hit the API multiple times, It returned a 401 error. finally, I got a 403 error- "**Too many invalid password attempts. Log in at <https://id.atlassian.com/> to restore access**."

Later I tried to log in with the Website, It worked with SSO Login.

It was not working in Postman which username and personal token.

I tried to revoke and try to do with a New token, Still, it's not working, 401 unauthorized.

Any way to reset or Solve to access from the postman, Appreciated.


Answers:
author: Mark C
body: Hi [@mahesh_brillio](/t5/user/viewprofilepage/user-id/3277175)

Thank you for reaching out to the community.

This is because of the "Too many invalid password attempts" error and it will need some time to refresh your account.  
In the meantime, would it be possible for you to use an [App password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) for basic authentication instead?

Let me know how it goes.

Regards,  
Mark C

comments: author: mahesh_brillio
body: Thanks Mark C for your Response.

Initially, I tried with App Password also, But it got Failed with 401. not sure what I missed.

As you said, Later some time I was trying back, It got Worked with Username and App Password.


Tags: bitbucket-cloud

cloud
How do I restrict a user or a group to a specific branch
Asked by Thirukumaran Kubendran:

How do I restrict a user or a group to have write permission to a specific branch?

I have created a group at the workspace level. In that group I have also added a repo also with write permission. I then go to repo setting \> branch permissions. In the write access permission section I am not able to see the group. I only see users in that list that too because they are admin in the workspace.

Why can I not see the group?

![bitbucket2.png](https://community.atlassian.com/t5/image/serverpage/image-id/186831i664DDE23161747FB/image-size/large?v=v2&px=999 "bitbucket2.png")

![image_2022-03-08_105736.png](https://community.atlassian.com/t5/image/serverpage/image-id/186829i9102E5D8BBD6E999/image-size/large?v=v2&px=999 "image_2022-03-08_105736.png")


Answers:
author: Caroline R
body: Hi, Thirukumaran, thank you for reaching out to Atlassian Community.

As you confirmed you have added this group to this repository with write permission, you should be able to add it to the branch permissions as well. I tested it and it's working for me, however, I need to start typing the group name to see it in the dropdown.

Could you please confirm if even when typing the group name, you can't see it there? If you can't, this could be a browser issue. In this case, I would ask you to test this in an incognito window using Chrome (the last version).

Please let me know how it goes and feel free to share any additional questions regarding this case.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud
build docker image via piplines but cannot find pipeline on navigation panel
Asked by XUESHAN_ZHANG:

I am using a local bitbucket server.

I am trying to build docker image from my code on bitbucket. From the official doc I found ([Build and push a Docker image to a container registry \| Bitbucket Cloud \| Atlassian Support](https://support.atlassian.com/bitbucket-cloud/docs/build-and-push-a-docker-image-to-a-container-registry/)), it shows I should configure piplines yml file as a prerequisite. However, I did not find 'piplines' on navigation panel on my bitbucket server. I am wondering if this is a paid service or I can install something like extension to use piplines.


Answers:
author: Norbert C
body: Hi [@XUESHAN_ZHANG](/t5/user/viewprofilepage/user-id/4768693)

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 would like to inform you that Bitbucket Server doesn't have "Pipelines" functionality as Bitbucket Server and Bitbucket Cloud are two different products.

As a workaround, I can recommend you to use [Atlassian Bamboo](https://www.atlassian.com/software/bamboo) as this is the Pipelines alternative (CI/CD tool) for Bitbucket Server.

Please let me know if you have any further question? We're here to help.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: XUESHAN_ZHANG
body: [@Norbert C](/t5/user/viewprofilepage/user-id/1190200)

thanks for your reply. Right now, no more questions.


author: Norbert C
body: You're welcome [@XUESHAN_ZHANG](/t5/user/viewprofilepage/user-id/4768693) I'm glad to hear I was able to help


Tags: bitbucket-server

server
Bitbucket stoped working after reinstallation of Jira
Asked by Stefan Tichelaar:

We are having a great deal of trouble to import a cloud site with +800 issues to our local server install of jira.

At the advice of the jira support people our IT dep. reinstalled the jira server, unfortunately we are still having the same issues.

But to make things worse our Bitbucket server stopped working too!

When trying to access the sever all we get are 404 and 500 error messages. Something related to "cwd_app_dir_mapping".

<br />

This seems to be an issue with the userdirectory, that was configured to use jira previously but still has two admin users in it's own primary userdirectory.

I tried resolution as stated:  
<https://confluence.atlassian.com/bitbucketserverkb/bitbucket-server-displays-404-j_bitbucket_security_check-after-user-directory-modifications-779171428.html>

But the "cwd_app_dir_mapping" seems ok. See attached image of query

![cwd_app_dir_mapping.jpg](/t5/image/serverpage/image-id/186792iEF33AC8558484534/image-size/large?v=v2&px=999 "cwd_app_dir_mapping.jpg")

We also tried starting with a recovery password but that also seems to fail.


Answers:
author: Stefan Tichelaar
body: The issue was finally resolved. Adding the solution here for other peoples reference.

During re-instalaltion of Jira the database user for jira was re-created with a different password than the previous installation.

When Bitbucket was installed the same database user was used for Jira and Bitbucket. So the database user in the Bitbucket.properties file of the Bitbiucket server still pointed to the correct database user but the password was in correct.

After we shut down the Bitbucket server, changed the password in the bitbucket.properties file and restarted the server again, we could login and re-instate the link to the Jira user directory.


Tags: bitbucket-server

server
App pass in Jenkins doesn?t work
Asked by Ramesh Kumar:

I am trying to change the authentication to app password for my account in Jenkins but still it throws a invalid credential error message if I use my app passw.


Answers:
author: Theodora Boudale
body: Hi [@Ramesh Kumar](/t5/user/viewprofilepage/user-id/4795135) and welcome to the community.

An app password should be used in combination with the Bitbucket username of the account for which you generated this app password. I am just mentioning this because I've seen some users have been using the label of the app password instead. The Bitbucket username can be found here <https://bitbucket.org/account/settings/> if you are logged in to the account.

If that's ok, the next thing to look into would be the app password permissions, and the correct permissions depend on what Jenkins is doing with these credentials. If it is only cloning/pulling from repos, then *Repositories:Read* permissions for the app password should be enough. If additional operations are performed, more permissions may be required for the app password. It is not possible to change the permissions for an existing app password, but you can generate a new one.

Is there some log file in Jenkins where you can see what git commands or API calls are executed, and also if there are any additional error messages apart from "invalid credential"?

Kind regards,  
Theodora

comments: author: Scott P
body: I can confirm.

Jenkins can now PULL, but it can no longer PUSH to repositories. I have had several repositories automatically pushing to branches based on requirements.

Jenkins can no longer PUSH to those same repositories. It will simply HANG.

The APPPassword I am using works to pull the code down, but it can no longer push the code up to Bitbucket.

I have given the AppPassword account full rights across the board.

I have tried to do this with command line (which worked before), moved over to powershell and even tried Shell commands.

Jenkins can no longer push with these new AppPasswords.


author: Theodora Boudale
body: Hi Scott,

If you'd like us to help with your issue, please create a new question via <https://community.atlassian.com/t5/forums/postpage/board-id/bitbucket-questions>

It's best to have a separate question, as troubleshooting multiple users' issues in the same post can become confusing and make it difficult to follow the post.

You can copy-paste in the new question the content of your previous reply, and it would additionally be useful to include:

* any logs from Jenkins with the exact commands that are executed and their full output (please mask/remove any actual usernames/repo names/workspace-id prior to sharing).  
  Without knowing the commands ++and++ their output, it's difficult to guess why the operations are failing.
* it would be useful to have the same (commands+output) when you execute the commands from a command-line application

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Pipeline IF statement multiple conditions
Asked by Dmitry Ofitserov:

Hi guys,

I'm trying to use multiple conditions in pipeline IF statement but with no luck.

The purpose of it is to run some functionality only if repository variable is set to specific value and specific file exists in directory (or if the directory itself exists, or both of the conditions) , e.g:  
if \[ $BOOLEAN_VAR = 'TRUE' \&\& -e "folder/file.xml" \]; then do something; fi  
I've tried a few variations of the above condition but each time I get the "syntax error".  
Did anyone use multiple conditions and can elaborate on how to do it ?  
Thanks


Answers:
author: Mark C
body: Hi [@Dmitry Ofitserov](/t5/user/viewprofilepage/user-id/4700745)

Welcome to the community.

Similar to [this community post](https://community.atlassian.com/t5/Bitbucket-questions/If-Else-condition-in-yml-file-bitbucket/qaq-p/1621579), would it be possible for you to try to use double squared brackets and see if it works?  
For example:

```
if [[ $BOOLEAN_VAR = 'TRUE' &&  -e "folder/file.xml" ]]; then do something; fi
```

Let me know how it goes.

Regards,  
Mark C

comments: author: Dmitry Ofitserov
body: Thank you [@Mark C](/t5/user/viewprofilepage/user-id/1210823)

The solution worked for me


author: Mark C
body: Great! Glad to know it worked.  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Cannot read from repository with publickey
Asked by Martin Fuhrer:

I have setup my personal account as a member of a workspace. I can browse the repos in the workspace within the browser. I also added an SSH key to my personal account. Running "ssh -v git@bitbucket.org" works and says something like "You can use git to connect to Bitbucket." But when I try to clone the repo I get the error "git@bitbucket.org: Permission denied (publickey)".

Accessing the same repo from another account (obviously with a different SSH key) works without any problem.

Do you have any ideas?


Answers:
author: Mark C
body: Hi [@Martin Fuhrer](/t5/user/viewprofilepage/user-id/4794109)

Welcome to the community.

To make sure your SSH key is in use, would it be possible for you to add it to your SSH agent?

```
eval $(ssh-agent)ssh-add <Private SSH key location>
```

Once done, try to clone again.

If the issue still persists, you can try to enforce your environment to use a specific SSH key identity by adding the configuration below in your SSH config file.

```
Host bitbucket.org  HostName bitbucket.org  IdentityFile <Private SSH key location>
```

If you don't have the SSH config file yet, you can create it first:

```
vim ~/.ssh/configchmod 600 ~/.ssh/config
```

Hope it helps and let me know how it goes.

Regards,  
Mark C

comments: author: Martin Fuhrer
body: Hi Mark,

Sorry for late answer, the move to bitbucket cloud has been postponed for some time. But now I'm ready to tackle it again.

Meanwhile I also found the problem. I had my .ssh folder in my Windows home folder, but git bash was using a different folder as home. After moving the keys there everything worked fine.


author: Mark C
body: No worries at all [@Martin Fuhrer](/t5/user/viewprofilepage/user-id/4794109)  

Glad to know that after moving your keys, everything worked fine.  

Do let me know if you have further questions that I can help with.  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud

public-key

ssh