youngmon/atlassian-qna huggingface dataset:
Is it possible to generate pull requests via scriptrunner for bitbucket server?
Asked by rgewondjan:

Summary Question: Can I generate a pull request using scriptrunner for bitbucket server?

<br />

Background:  

I am working on a certain workflow that requires PRs to multiple branches when a change needs to be made, and right now individuals must create all 3 PRs by hand (or in some cases with custom scripts that use bitbucket API).  

I am interested in finding a way to generate 2 of the PRs when 1 is created, or perhaps I will decide to generate all 3 PRs based on some other event.  

I learned from this page how to implement a custom listener:

<https://scriptrunner.adaptavist.com/6.9.2/bitbucket/StashEventHandlers.html#_working_with_custom_listeners>

<br />

<br />

However, my challenge is not on triggering the event, but it is in finding how to cause another event to occur, specifically the generation of a pull request.  

I did find this: <https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Automatically-create-master-branch-on-repository-creation/qaq-p/94060>

which led me to this: [https://gist.github.com/jechlin/6365d2e3c0ef4b94deb636db9c2cde7d](https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Automatically-create-master-branch-on-repository-creation/qaq-p/94060)

That gave me hope that maybe it was possible to do what I am trying to do, since this script also causes an event to occur.

I also consulted the atlassian documentation. There I found 2 docs that seemed to be a promising way to create a Pull Request using ScriptRunner.

<https://docs.atlassian.com/bitbucket-server/javadoc/6.7.1/api/index.html?com/atlassian/>

Then search: "com.atlassian.bitbucket.pull"

<br />

From what I can see we would:  

Use PullRequestService to create a pull request (interface).

Use PullRequestCreateRequest class as parameter for class that implements PullRequestService.

Unfortunately without any concrete examples, there will be a lot of trial and error and guessing how to put the pieces of this code together, and it might not work when all is said and done, but here's hoping!  

Additionally, if you have other suggestions for accomplishing the same task, I would also welcome those suggestions. Any insight is greatly appreciated!


Answers:
author: Robert Giddings [Adaptavist]
body: Hi [@rgewondjan](/t5/user/viewprofilepage/user-id/4243206) ,

We have recently added a script to our Adaptavist Library that shows you how to use the PullRequestService to programmatically create Pull Requests using ScriptRunner for Bitbucket.

The script is available here: <https://library.adaptavist.com/entity/create-a-pull-request>

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket


Tags: addon-com.onresolve.stash.groovy.groovyrunner

bitbucket-server

scriptrunner

server
?omments are considered incorrect
Asked by ????? ?????:

Hi!  
I develop plugin for Bitbucket Server version 7.6.0.  
I want to get all comments on pull request. I use method commentService.search

```
commentService.search(new CommentSearchRequest.Builder(pullRequest).build(), new PageRequestImpl(0, 100));
```

This method don't return all comments but only file's comment.  
What do i do wrong and how i can fix this?


Answers:
author: ????? ?????
body: nessesary to use   

```
CommentSearchRequest.Builder builder = new CommentSearchRequest.Builder(pullRequest);
builder.anchorState(CommentThreadDiffAnchorState.ALL);
```

```
commentService.search(builder.build(), new PageRequestImpl(0, 100)).getSize();
```


Tags: bitbucket-server

server
Bitbucket on RHEL 7.9
Asked by Stephen Stoltz:

Does Bitbucket run on RHEL 7.x and is there any know issues using RHEL vs using Ubuntu?


Answers:
author: Pramodh M
body: Hi [@Stephen Stoltz](/t5/user/viewprofilepage/user-id/4191796)

The pre-requisites for Bitbucket to install is git, Perl, and Elasticsearch (Please see the full list here <https://confluence.atlassian.com/bitbucketserver/supported-platforms-776640981.html>)

<https://confluence.atlassian.com/bitbucketserver/running-bitbucket-server-with-a-dedicated-user-776640047.html>

If you have the required tools ready, **it's supported on RHEL 7.9.**

Thanks,  
Pramodh


Tags: bitbucket-server

server
Integrating Crowd for Bitbucket Server with Atlassian Cloud SSO using Okta
Asked by Matthew Day:

We migrated from Server to Cloud for Jira and Confluence after securing access to it with Atlassian Access and Okta (our SSO provider). We broke our Bitbucket Server integrations when that occurred. Does anyone have experience in using Crowd to sync these access systems so that I can reintegrate Bitbucket with Jira and Jira Service Management?


Answers:
author: Pramodh M
body: Hi [@Matthew Day](/t5/user/viewprofilepage/user-id/1631801)

Replacing the Server URL with the Cloud URL would suffice.

The crowd is for User management - since authentication changed re-establishing the connection would integrate the systems.

If you have to use OAuth, please let me know.

Thanks,  
Pramodh

comments: author: Matthew Day
body: Hi [Pramodh!](https://community.atlassian.com/t5/user/viewprofilepage/user-id/3691224)  
Thank you for answering, and apologies for the very late reply. I don't really check email often. :-(  
RE: 'Replacing the Server URL with the Cloud URL would suffice.'  

I don't understand. I'm the manager, so I haven't set this up. Do you mean the Jira Server URL in Bitbucket being replaced with the Atlassian Cloud instance URL?   

Our Bitbucket server instance (on prem) isn't currently accessible external to our internal network. Staff need our VPN active to access it. If it were externally accessible (easily enough to setup with our load balancers), it would need SSO enabled and require Okta.   

If the flow between these systems us uni-directional (Bitbucket -\> Jira), then what you say may work. If these systems have bi-directional requirements (Bitbucket \<--\> Jira), then I think there is more work involved.   

I'm told Bitbucket DataCentre, which natively supports Okta, might be a solution; however, I still need to understand if the flow is one way or both ways.


Tags: bitbucket-server

server
cant get any mail from bitbucket server
Asked by harsh.shah:

Hi, one of my colleague 'parth.mewada@mantratec.com' not get account verification mail and also other mails from bitbucket.

can you please help me out ?


Answers:
author: Theodora Boudale
body: Hi [@harsh.shah](/t5/user/viewprofilepage/user-id/4242648) ,

I checked in our system and I saw a hard bounce event for this email created a few days ago with the message:

```
550: 550 Requested action not taken: mailbox unavailable
```

There might have been an attempt to create an account or send an invitation before the email was operational. The hard bounce informs us that the email does not exist and in this case it is placed in a suppression list, as we no longer try to resend to non-existing emails.

I went ahead and removed the email from the suppression list.

Could you please ask your colleague to select the **Resend signup link** now?

In case any invitations were sent to this user, could you please resend them as well?

A new invitation needs to be sent and also a new verification email needs to be requested, as the previous ones were dropped.

Please feel free to let me know if things are ok now and if you need anything further.

Kind regards,  
Theodora


Tags: bitbucket-cloud

email
How can i fix this with reverse proxy
Asked by KIeran Slayers3.0:

```
[Fri Jan 29 00:16:31.883819 2021] [core:notice] [pid 22398] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jan 29 00:16:39.953749 2021] [proxy:error] [pid 22399] (111)Connection refused: AH00957: HTTP: attempt to connect to x.x.x.x:8084 (ns2.gothammc.net) failed
[Fri Jan 29 00:16:39.953863 2021] [proxy_http:error] [pid 22399] [client 141.101.98.189:51026] AH01114: HTTP: failed to make connection to backend: ns2.gothammc.net
[Fri Jan 29 00:16:40.299064 2021] [proxy:error] [pid 22403] (111)Connection refused: AH00957: HTTP: attempt to connect to x.x.x.x:8084 (ns2.gothammc.net) failed
[Fri Jan 29 00:16:40.299219 2021] [proxy_http:error] [pid 22403] [client 141.101.98.25:42186] AH01114: HTTP: failed to make connection to backend: ns2.gothammc.net, referer: https://git.gothammc.net/


That what i get from my apache2 
here is my apache12 config
<VirtualHost *:443>
ServerName git.gothammc.net

ProxyRequests Off

<Proxy>
Require all granted
</Proxy>

ProxyPass / http://ns2.gothammc.net:8084/
ProxyPassReverse / http://git.gothammc.net:8084/

SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/git.gothammc.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/git.gothammc.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/git.gothammc.net/chain.pem
</VirtualHost>

<VirtualHost *:80>
ServerName git.gothammc.net
Redirect Permanent / https://git.gothammc.net/
</VirtualHost>
```


Answers:
author: Pramodh M
body: Hi [@KIeran Slayers3.0](/t5/user/viewprofilepage/user-id/4242096)

Please confirm the following, your server is **reachable via <http://git.gothammc.net:8084> ?**

Thanks

comments: author: Pramodh M
body: FYI,

You have done the changes to bitbucket.properties to include proxy information right ?

Please follow the guide to make necessary changes to bitbucket.properties file to include proxy information

##### server.port
server.proxy-name
server.proxy-port
server.redirect-port {#toc-hId-1905592502}

<https://confluence.atlassian.com/bitbucketserver/bitbucket-server-config-properties-776640155.html>


Tags: bitbucket-server

server
Why does Bitbucket render Markdown files (.md) file differently than CommonMark?
Asked by Jonathan Brinkley:

I have a CHANGELOG.md file that I have created for my respoitory where I list the issues resolved in the latest release of code. I am using the following syntax between release entries:

## \[x.y.z\](<https://bitbucket.org/{repository}/commits/tag/x.y.z>) {Description} (YYYY-MM-DD)  
### Improvements- \[JIRA {issue id}\](issue URL) {Description}

\<br\>\</br\>  
---  
## \[x.y.y\](<https://bitbucket.org/{repository}/commits/tag/x.y.y>) {Description} (YYYY-MM-DD)

The problem comes up when I try view the file online in Bitbucket its not ignoring the break (\<br\>\</br\>). When I view this in CommonMark the reference provided in the documentation it works as expected, but not when I view the file online in Bitbucket.


Answers:
author: Theodora Boudale
body: Hi Jonathan,

I'm afraid that we don't support arbitrary HTML in Markdown, which is why you can view \<br\>\</br\> in your .md file instead of a line break.

That being said, we have a Labs feature to allow some HTML tags to be embedded in markdown files.

If you log in to Bitbucket Cloud website, then go to your avatar \> **Labs** , you can find and enable **Embedded HTML in markdown**. After you do, you can edit the file and after committing changes, \<br\>\</br\> should no longer be displayed.

Please note that this feature is still in Beta, so there are some bugs related to it, e.g. <https://jira.atlassian.com/browse/BCLOUD-20746>.

Kind regards,  
Theodora

comments: author: Jonathan Brinkley
body: Thank you I will wait for the changes to come out of beta.


Tags: bitbucket-cloud

cloud
repo backup and restore with git-lfs files
Asked by sjamisorc:

I have many repos in Bitbucket cloud and make a local backup using git clone --mirror but that does not capture the git-lfs files.

How do I backup the git-lfs files and restore them in addition to the mirrored repo backup?


Answers:
author: Theodora Boudale
body: Hi [@sjamisorc](/t5/user/viewprofilepage/user-id/1194855) ,

You can fetch lfs objects in a mirror clone with the command

```
git lfs fetch --all
```

The command needs to be executed inside the directory of the mirror clone.

For restoring, after you push the mirror repo, you can do

```
git lfs push --all <repo-url>
```

Kind regards,  
Theodora


Tags: backup

bitbucket-cloud

cloud

git-lfs
I can't delete a project
Asked by Pablo Leone:

The project is empty but I still see the error message.

How can I delete a project in this scenario?

Thank you.

![Screenshot 2021-01-28 at 20.28.39.png](https://community.atlassian.com/t5/image/serverpage/image-id/127890iFB7A8F8ADBA2F9EC/image-size/large?v=v2&px=999 "Screenshot 2021-01-28 at 20.28.39.png")![Screenshot 2021-01-28 at 20.28.34.png](https://community.atlassian.com/t5/image/serverpage/image-id/127889iFFB5559CE2E7F577/image-size/large?v=v2&px=999 "Screenshot 2021-01-28 at 20.28.34.png")


Answers:
author: Theodora Boudale
body: Hi Pablo,

Checking your account and the workspaces you have access to in our system, I believe this may be happening because that the project contains a Mercurial repo (which won't show up).

You can contact Bitbucket Cloud support team, let them know which project you are trying to delete and in which workspace and they'll assist you with this. You can open a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

project
Workspace disappeared
Asked by helenpostle:

in Bitbucket I used to have 2 workspaces:

Helen Postle and Handsam_IT

my boss created a new workspace and gave me access to it, now I can my workspace and the new one he created but Handsam_IT has disappeared. I asked him to invite me to this workspace again but he said when he tried that it said I was already a member. How can I get this workspace back?


Answers:
author: helenpostle
body: Its OK, I've found it, I have 2 logins one with my work email and one with my personal email. I don't use the one with my work email and thats who he invited to the new workspace. When I log in as myself, I can see the old workspace. Phew


Tags: bitbucket-cloud

cloud
In aws-sam-deploy pipe, can the lambda uploaded to S3 with a lambda function name?
Asked by Chyn:

In pipe - aws-sam-deploy package-only, can we have option to put the lambda function name as prefix automatically before upload the zip file to S3?

Ex. Instead of "12af3377de8d9c743192c0182f3b7322" in the S3, can we have "my-lambda-name-12af3377de8d9c743192c0182f3b7322" in S3 ?

This will ease the maintenance of the bucket.


Answers:
author: Halyna Berezovska
body: [@Chyn](/t5/user/viewprofilepage/user-id/4217456)thanks for the question!

sam package has the parameter in cli --s3-prefix, and if to pass there this prefix, it creates the folder with s3-prefix name in the root and inside that folder there is your code.

It will look like this:

s3://your-bucket/HelloWorldFunction/\<uuid\> .  

Would be such result fine for you?

I suppose that there is no any other option according to [aws sam cli documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html)

But in the case if you upload several resources to s3 bucket, you can use s3 prefix to put needed code in folder and simply reach it by lambda function name.

Since there will be just one zip inside that folder, you can simply list objects in the folder and get its arn or s3 url, if you need.

If such result is ok for you, we will consider your case as the feature request to our pipe.

Regards, Galyna

comments: author: Chyn
body: Ok that help. Thanks !


author: Halyna Berezovska
body: [@Chyn](/t5/user/viewprofilepage/user-id/4217456)ok then, I'll update you when we maintain this in future release.

Cheers, Galyna


author: Vlad Kalinin
body: Adding support for --s3-prefix param in the aws-sam-deploy pipe would be great indeed!


author: Pieter Vandenburg
body: Yes, I've hit a wall because of the \`--s3-prefix\` issue. I've updated the source locally to support it, would love to send it to Atlassian to get it added.


Tags: aws

bitbucket-pipelines

cloud
I stopped receiving email notifications
Asked by Andrew D. McGuire:

I stopped receiving email notifications a few weeks ago, without making any changes to my user settings. I imagine I am on the suppression list mentioned in these posts:  

- <https://community.atlassian.com/t5/Bitbucket-questions/I-stopped-receiving-email-notifications/qaq-p/1478249>

- <https://community.atlassian.com/t5/Bitbucket-questions/I-stopped-receiving-bitbucket-email-notifications/qaq-p/1088558>

- <https://community.atlassian.com/t5/Bitbucket-questions/Not-receiving-emails-of-pull-requests/qaq-p/1350499>

Could someone please investigate?


Answers:
author: Theodora Boudale
body: Hi Andrew,

I checked in our system and saw a hard bounce event for the email of your community account with the message:

```
550 5.1.1 Recipient not found.

```

It's possible that there was an issue with your mail server, Bitbucket tried to send an email notification during that time, and received a hard bounce response. The hard bounce informs us that the email does not exist and in this case it is placed in a suppression list, as we no longer try to resend to non-existing emails.

I went ahead and removed your email from the suppression list.

Could you please monitor this and let us know if you are receiving email notifications now?

Kind regards,  
Theodora


author: Brant Schroeder
body: [@Andrew D. McGuire](/t5/user/viewprofilepage/user-id/2038528)

I have escalated this to the Atlassian team who will be able to assist you further.


Tags: atl-rvw

bitbucket-cloud

cloud
How may I see the owner of a workspace?
Asked by Fredrik Gustafsson:

How may I see the owner and contact address of a workspace that is not mine?

(I might have created a workspace using a different account, but forgot which, and now I want to reuse the workspace name for my real project ? )


Answers:
author: Soumyadeep Mandal - SaM
body: Hi [@Fredrik Gustafsson](/t5/user/viewprofilepage/user-id/360867) ,

I don't think you can do anything in this case.

If the workspace is private and not belongs to you then you can't access it.

If you can access or view the workspace or you a member of the workspace but forgot the email id or login to your workspace admin account you can contact [HERE](http://support.atlassian.com/contact)

Regards,

***Soumyadeep***


Tags: bitbucket-cloud

cloud
Bitbucket Server Migration Licences and Other requirements
Asked by Nathan_Scullen:

Hi Bitbucket Community!

I am trying to migrate our Bitbucket Server Instance from the old windows location to a new windows location, I am very inexperienced with infrastructure and networking so apologies in advance.

Currently the new server location is locked down unable to get access to the internet unless I get specific approval.

The old instance has this licence: **Bitbucket (Server) 10 Users: Starter License**

I have installed Git + Bitbucket and Now when I boot up the start screen I am met with the "*License Key: I need an evaluation licence OR I have a bitbucket licence key* "   

**How do I proceed past this point?**

**Do I get permission to use the internet, log in with the admin Atlassian account and then log into the old instance export the data migrate it across and that's all done?**

<br />

**What access and ports are required, the direction and the urls to build an approval request?**


Answers:
author: Christian Glockner
body: Hi Nathan,

You don't need internet access from the Bitbucket Server machine to get your license key. You can simply log into <https://my.atlassian.com> from any workstation, where you'll be able to find your existing license key or generate a new evaluation license.

Cheers,

Christian

Premier Support Engineer

Atlassian


Tags: bitbucket-server

licence

migration

server
How do I connect to bitbucket server in Visual Studio 2019?
Asked by nutbolts:

I use Visual Studio 2019 and want to see how I can connect to bitbucket server with it with some helpful steps or guide?


Answers:
author: Soumyadeep Mandal - SaM
body: Hi [@nutbolts](/t5/user/viewprofilepage/user-id/4240303) ,

Welcome to the community!

Please read and follow this article

<https://zhengwu.org/bitbucket-server-integration-with-visual-studio-code-on-windows/>

I hope it will solve your issue!

Regards,

***Soumyadeep***

comments: author: nutbolts
body: I saw that guide but it refers to visual studio code which I see has a plugin for atlassian, however my question was around the IDE Visual Studio 2019. If anyone know of an extension which works with bitbucket server then do let me know


author: Soumyadeep Mandal - SaM
body: Hi [@nutbolts](/t5/user/viewprofilepage/user-id/4240303) ,

Please have a look at this extension

<https://marketplace.visualstudio.com/items?itemName=MistyK.VisualStudioBitbucketExtension>

Regards,

***Soumyadeep***


author: sriprasanna.mg
body: Hi [@Soumyadeep Mandal - SaM](/t5/user/viewprofilepage/user-id/4216583)

The extension you mentioned seems to work for Bitbucket cloud not for data center.

Also for cloud, the extension is very primitive and quite buggy. I cannot make inline comments and the comments loo weird. No side by side diff is available. Are there any plans from Atlassian to create a good plugin for Visual Studio? (not VS Code)


author: robert
body: I agree. I would love to see a video or detailed example (or better yet a trivially simple to JUST USE extension for Visual Studio 2019 IDE).

We use BB Cloud and although I added the extension for Atlassian BB, I cannot even be sure where it interacts with Visual Studio. It seems to hijack the Git Source Control extension. Sometimes it seems to work with cloud but most often it just fails to even recognize changes.


author: Greg Burns
body: [@robert](/t5/user/viewprofilepage/user-id/3628975) I tried that extension with VS 2019 originally but I don't think it even necessary anymore. I don't have it installed in either VS 2019 or VS 2022 and commit to BB Cloud all the time.

As I recall though the key to getting that extension working was it wanted a token not an actual password to login. You can make a token for you account from inside BB Cloud.

<https://id.atlassian.com/manage-profile/security/api-tokens>

But, like I said, with the latest versions of 2019 and 2022 I don't think I need it installed at all.

If I have a BB repo cloned to my machine, VS just appears to work with it naturally.


Tags: bitbucket-server

server
Error in the explanation to split repo
Asked by Meir Kalter:

Hi,

I want to split my repo.

Therefore i tried to use the explanation the explanation what should be done.

In the second step - the following command:

git remote add origin https://tutorials@bitbucket.org/tutorials/freshrepo.git

failed with error :

C:\\testsplit\\freshrepo\>**git filter-branch ...**   
fatal: bad revision 'RM'

Do you have any idea?


Answers:
author: Warren Boucher
body: Windows needs double quotes.  
git filter-branch --index-filter "git rm --cached -r lildir lildir2" -- --all


Tags: bitbucket-cloud

repository