youngmon/atlassian-qna huggingface dataset:
Can't send variables to Pipeline using the API
Asked by David Fernandes:

Greetings,

I can't send variables to my Pipeline using the API. The Pipeline is successfully triggered but the variables do not show up...here's my cURL:  

```
curl -X POST --url 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pipelines' --header 'Authorization: Bearer <token>' --header 'Content-Type: application/json' -d '{"target":{"type":"pipeline_ref_target","ref_type":"branch","ref_name":"main","variables":[{"key":"MY_VAR","value":"test","secured":false}]}}'
```

Appreciate any help.


Answers:
author: David Fernandes
body: Found the problem, the body of my POST was wrong, here's the correct version:

```
curl -X POST --url 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pipelines' --header 'Authorization: Bearer <token>' --header 'Content-Type: application/json' -d '{"target":{"type":"pipeline_ref_target","ref_type":"branch","ref_name":"main"},"variables":[{"key":"MY_VAR","value":"test"}]}'
```


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Change admin of bitbucket
Asked by seb gerard:

Hi, former admin left the company without transferring the account.

The organisation email is no longer active neither.

Any clue how we can move on quickly as we are blocked as we hit the free limits.

Thanks


Answers:
author: Ste Wright
body: Hi [@seb gerard](/t5/user/viewprofilepage/user-id/5453520)

It's probably easiest to reactivate the Org Admin's email address, and ask your IT Team to grant you access so you can login and make the relevant changes.

Otherwise, you could contact Support to see if they can help? Contact them here - <https://support.atlassian.com/contact/#/>

Ste

comments: author: seb gerard
body: Hi [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) this is exactly what we did during the weekend. Goes faster :). Nice one. Cheers. Seb


Tags: bitbucket-cloud

cloud
recovery a repository
Asked by Jeriam:

i give the message about space, and i delete a few repositories.

but i exclude a important repository that i need recovery.

how a do this?


Answers:
author: Nikola Perisic
body: Hello [@Jeriam](/t5/user/viewprofilepage/user-id/2044118)

The solution you are looking for is here: <https://community.atlassian.com/t5/Bitbucket-questions/Recovery-delete-repository/qaq-p/1384464>

There isn't a direct way of restoring a deleted repository, rather using Rewind app to recover your repo: <https://rewind.com/blog/recovering-a-deleted-github-repository/>

As a last resort, you would need to contact the Bitbucket support: <https://support.atlassian.com/contact/>


author: Jeriam
body: Hi perisic, thanks for your reply.

I follow this instruction: <https://confluence.atlassian.com/bbkb/reinstating-deleted-bitbucket-repositories-from-a-local-copy-1217301861.html>

and works fine for me.

thans for your time.


Tags: bitbucket-cloud

cloud
how to set up bitbucket pipline for pmd
Asked by MANGESH PATIL:

Hi

I have configured the pipeline for pmd as follows.

wget <https://github.com/pmd/pmd/releases/download/pmd_releases%2F7.0.0-rc1/pmd-bin-7.0.0-rc1.zip>  
- unzip pmd-bin-7.0.0-rc1.zip  
- echo "Make sure there is no PMD error with a high priority"  
- pmd-bin-7.0.0-rc1/bin/pmd.bat check -minimumpriority $PMD_MINIMUM_PRIORITY -d force-app -R custom-apex-rules.xml -f text -l apex  
I tried with different option like  
pmd-bin-7.0.0-rc1/bin/pmd.bat check  
pmd-bin-7.0.0-rc1/bin/pmd check  
but it is now working.  
Thanks in advance.

*** ** * ** ***


Answers:
author: Syahrul
body: G'day, [@MANGESH PATIL](/t5/user/viewprofilepage/user-id/5452957)

Welcome to the community!

I believe the path is incorrect, could you try using for example the following path:

```
/opt/atlassian/pipelines/agent/build/pmd-bin-7.0.0-rc1/bin/pmd check -minimumpriority $PMD_MINIMUM_PRIORITY
```

Let me know if that works.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
How I can trigger garbage collection manually
Asked by time:

How I can trigger garbage collection manually, as I already made remove of the dangling commits


Answers:
author: Ste Wright
body: Hi [@time](/t5/user/viewprofilepage/user-id/5453643)

I don't believe there's a native feature for this - there's a feature request though, which has a workaround listed on it. Check that out here: [BCLOUD-11593](https://jira.atlassian.com/browse/BCLOUD-11593)

You should also be able to request GC from Atlassian Support - contact them here: <https://support.atlassian.com/contact/#/>

Ste

comments: author: time
body: [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)thanks for your reply, but I am using plan and unfortunately I can't do directly, maybe from Atlassian Support will answer here, or please if you know someone please tag in this loop and maybe I will be helped.  
Thanks in advance


author: Ste Wright
body: I'll mention it to them :)

Ste


author: Ben
body: G'day!

It is correct that it is not possible to manually trigger a garbage collection from your side. There is an automated process which will execute a gc based on a certain threshhold of garbage (ie dangling commits, unpacked refs) is reached.

I have raised a support ticket in our system for you, as we will need access to your repository in the backend to execute a gc on our side (and this requires a formal ticket for authentication purposes). Usually we can do this without a ticket, but the size has not reduced based on our automated tooling so we will need to investigate this further.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: atl-rvw

bitbucket-cloud

cloud
Bitbucket Pipeline Timeouts on npm install
Asked by Kiril Velichkov:

We have bitbucket project that uses bitbucket pipelines.  

Here is what our pipeline looks like  

\`\`\`  
image: node:18.17.0  
pipelines:

feature/\*:  
- step:  
name: Unit Tests and Linting  
script:  
- npm install  
- npm run lint  
- npm run test:coverage -- --runInBand  
\`\`\`  

Everything was working fine for a year, but since yesterday the pipeline started to timeout on the npm instsall command.  
I have tried to re run old pipeline that have passed before, but they still fail, which means the issue is not introduced by a change from us, because we haven't even changed the package.json for a long time.  

<br />

Any ideas or suggestions what could have caused this issue and how to fix it?


Answers:
author: Kiril Velichkov
body: seems like my issues is a duplicate of <https://community.atlassian.com/t5/Bitbucket-questions/Pipelines-getting-stuck-on-npm-i/qaq-p/2640307>


author: Kiril Velichkov
body: Thank you [@Eduardo Asenjo](/t5/user/viewprofilepage/user-id/2394415)   
I will try this and write back later


author: Eduardo Asenjo
body: Not a full solution to your problem, but a recommendation.

Recommendation 1:

Use \`npm ci\` instead of a full install. \`npm ci\` will install directly the definitions from the \`package-lock.json\` instead of getting latest version of everything from your package.json and recalculating everything. It will be more consistent with your developer and local machines.

Recommendation 2:

When using \`npm\` I'd recommend to use the \`cache: node\` bitbucket pipeline notation, so it will cache all packages and save loads of time when running that steps.

Take a look to this: [Caches \| Bitbucket Cloud \| Atlassian Support](https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/)

This may make your builds slightly faster and potentially prevent this timeout issue.


Tags: bitbucket-cloud

cloud
Mirror Gitlab to Bitbucket Cloud - Authentication problem with bitbucket.
Asked by c0un7z3r0:

I am trying to setup mirroring so that I can push any commits I make to my local gitlab instance to my bitbucket repo. I have created an access token on my bitbucket repo but any attempt to add it to the mirroring in gitlab results in authentication errors regardless of which protocol I use

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

If I hover over the respective ERROR pill as shown in the screenshot it says the following:  
SSH:  
"13:get remote references: create git ls-remote: exit status 128, stderr: "Host key verification failed.\\r\\nfatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\\n"."  

HTTPS:  
"13:get remote references: create git ls-remote: exit status 128, stderr: "remote: Invalid credentials\\nfatal: Authentication failed for '[https://bitbucket.org/workspace-id/xxxx-repo-name-xxxx.git/'\\](https://bitbucket.org/workspace-id/xxxx-repo-name-xxxx.git/'\)n"."   

I am at a loss as to what the problem is, I know the credentials are correct. I have added bitbucket.org to my known-hosts and I dont know what to try next. Any help would be appreciated. Thank you


Answers:
author: Theodora Boudale
body: Hi,

For authentication via HTTPS:

++If you use the credentials of a Bitbucket Cloud account, you need to use++

* the Bitbucket username, which can be found here: <https://bitbucket.org/account/settings/>
* an app password for the account with **Repositories Read - Write** permissions. The account's password will not work, you will need to use an app password: <https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>

++If you use a Repository Access Token:++

* The username (for clone/push operations) should be the string **x-token-auth** (reference: <https://support.atlassian.com/bitbucket-cloud/docs/using-access-tokens/>)
* The password should be the repository access token

For SSH authentication, you would need to set up SSH keys. The message **Host key verification failed.** also indicates that the host key of Bitbucket cloud is not present in GitLab's known hosts. Do you perhaps have a link to the documentation you are following in order to set this up with SSH?

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

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

gitlab

ssh-key
Facing error in sending email using bitbucket email pipe.
Asked by Abinaya Abi:

I am trying to send mail with cucumber report zip file attached with it.

My configuration settings:  
image: cypress/base:20.9.0  
pipelines:  
default:  
- step:  
name: Cypress Tests  
caches:  
- node  
script:  
# install dependencies  
- npm ci \|\| true  
# run Cypress tests in electron  
- npx cypress run --spec cypress/e2e/\*\*.feature \&\& node ./cypress/cucumberReport.js  
after-script:  
- apt-get update \&\& apt-get install -y zip  
- zip -r cucumber-report.zip cypress/cucumber-report/  
- STATUS="success"  
- if \[\[ $BITBUCKET_EXIT_CODE -ne 0 \]\]; then STATUS="FAILED" ; fi  
- pipe: atlassian/email-notify:0.13.1  
variables:  
USERNAME: 'XXXXXXXXX@gmail.com'  
PASSWORD: 'YYYYYYY'  
FROM: 'XXXXXXXXX@gmail.com'  
TO: 'YYYYYYYYYYY@gmail.com'  
HOST: 'smtp.gmail.com'  
SUBJECT: 'BUILD# ${BITBUCKET_BUILD_NUMBER} ${STATUS}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH}.'  
ATTACHMENTS: 'cucumber-report.zip'  
cucumber-report folder consist of 3 folders. Assets folder, features folder and index.html. I can able to zip the folder. But I can't able to send the mail. it was throwing an error mentioning "`Check your configuration settings."`


Answers:
author: Oleksandr Kyrdan
body: Hi [@Abinaya Abi](/t5/user/viewprofilepage/user-id/5452919)

Thanks for your question!

Try to add DEBUG variable to [email-notify pipe](https://bitbucket.org/atlassian/email-notify) to see more details about your error:

```
script:  - pipe: atlassian/email-notify:0.13.1    variables:      ...      DEBUG: "true"
```

Best regards,  
Oleksandr Kyrdan


Tags: bitbucket-cloud

cloud
Is there a way to list all commits on one deployment build?
Asked by Ahmed Eldably:

Hi,

I am currently working with Bitbucket API to automate some processes to calculate the cycle time of features.

I wonder if there's a way to get the commits on a certain deployment. I read the documentation about the pipelines and deployments endpoints, but I only got the merge commit to the deployment branch.

Please let me know if there's a way.

I appreciate any help you can provide.


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

The pipelines and deployments API endpoints will only return the commit that triggered the build or deployment. I'm afraid it is not possible to get that info via API.

I can create a feature request for our development team to consider. Could you please confirm first: when you say all commits on a deployment, do you mean all commits that were included in the push that triggered the deployment?

Kind regards,  
Theodora

comments: author: Ahmed Eldably
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

Thanks a lot for your reply!  

More specifically, in our case, the pipeline gets triggered with the merge commit from branch_x to the main branch on a certain deployment environment. So in this case we have other commits that also make their way into the production environment (for example).  

It is useful for us to access all these commits to make some calculations related to feature tracking. Could you make a feature request, please?  

Kind regards,  
Ahmed


author: Vishaal Kant
body: I have the similar requirement. I wanted to know the commits that were checked in into the branch before the pipeline triggered. From the pipeline I wanted to fetch all the commits from that pipeline. Is. there any workaround on a short term which can be implemented to get the commits using the Bitbucket API?


Tags: bitbucket-cloud

cloud
Automatically resolve merge conflicts in package-lock.json
Asked by Milad:

Dear Atlassian community,

in our pull-requests, by far the highest source of merge conflicts is the package-lock.json file (used by NPM). Default git can never automatically merge changes in that file, so every change will cause a merge conflict. This causes a manual resolving and rerunning the build.

I was wondering if there is a way to improve this. There is <https://www.npmjs.com/package/npm-merge-driver> which when installed will auto-resolve merge conflicts in package-lock.json. Is there a way to install this on Bitbucket?

Regards,

Milad


Answers:
author: Saxea _Flowie_
body: Hi Milad,

I think the closest you can get to "install" on Bitbucket, is by running it on a pipeline and automating it there. Bitbucket doesn't support merge drivers, but there is a feature request [here](https://jira.atlassian.com/browse/BCLOUD-12935).

[Flowie](https://flowie.app) (an addon that we provide) has support for .gitattributes, so it should be possible to add support for resolving conflicts automatically. If you are interested, please reach out to our support and we will be able to assist you with this.


Tags: bitbucket-cloud

cloud
I don't receive the verification code
Asked by Luc Felix:

For some unknown reason I've been kicked out of bitbucket and I now need to enter a verification code to get back in. But I don't receive the verification code in my Authenticator app. I used to receive the code but I don't anymore.   
I'm suspecting this has something to do with the fact that I changed phone. My new phone is exactly the same as the old one and has the exact same name. Could it be that the code is sent to my old phone which has been reset?

How can I get back in?   
THanks for your help


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

Bitbucket Cloud uses Atlassian accounts (the ones for <https://id.atlassian.com/>) for authentication. At the moment, it is possible to set up 2FA both for a Bitbucket account and also for an Atlassian account and I see that this is the case with your account (you have set up 2FA both for the Atlassian and the Bitbucket account).

If you do that, you'll get asked for a 2FA code twice when logging in to Bitbucket, once for the Atlassian account and once for the Bitbucket account. There should be two separate entries/accounts in the authenticator app, one for the Atlassian account and one for the Bitbucket one, and you can't use the codes of one for the other.

If the authenticator app on your phone doesn't have any entries for Atlassian or Bitbucket, you can disable 2FA (and then set it up again if you want). The following knowledge base article has steps on how to do that:

* <https://confluence.atlassian.com/bbkb/how-to-disable-reset-2fa-on-bitbucket-cloud-and-atlassian-account-1236932929.html>

Please feel free to reach out if you have any questions.

Kind regards,  
Theodora


author: Sebastian Krzewi?ski
body: Hi [@Luc Felix](/t5/user/viewprofilepage/user-id/5452488)

Please contact with Atlassian Support to get back access to your account (support.atlassian.com).

Regards,

Seba


Tags: bitbucket-cloud

cloud
Is there a way to customize (control) Objective of review?
Asked by Peter Mitev:

Currently when you create a branch based review, Objective section of the review is filled from all commit messages in the branch.

Are there a ways to control that behaviour?


Answers:
author: gustavo_refosco
body: Hi Peter,

Yes, you can define the default objectives at **Crucible Administration \> Projects \> Edit Crucible Settings \> Default review objectives**. If this is set, then the branch review won't add the commit messages in the objectives field.

If you don't want to set anything to the review objectives at all, you can just insert an empty space character as a default review objectives. I understand though this is merely a workaround, so I've created the improvement request <https://jira.atlassian.com/browse/CRUC-7231> suggesting the change on this feature. Please feel free to vote for this, as well as adding yourself as a watcher to it to track its progress.

Regards,

Gustavo Refosco
Is it possible to set a Assignee and a Lable/Component for Jira tasks created from Crucible?
Asked by L. Schimmel:

Hi,

I already figured out how to create JIRA Issues from Crucible Comments/Defects. But there is only an option to set the corresponding Project an description to the issue. When I look it up after creation, the task is neither assigned to a person (which would likely be the author) nor to a Lable or Component.

So I have to to that in another step, wich is a inconvinience. Is there a way to assign the issues manually or automatically during the creation in Crucible?


Answers:
author: Tini Good
body: To my knowledge, not from Crucible. However, you can configure JIRA to assign a default Assignee for all new Issues by setting "Allow unassigned issues" to OFF in your project configuration. See: <https://confluence.atlassian.com/display/JIRA/Configuring+JIRA+Options>

That should apply even if they are created from Crucible. Unfortunately, since JIRAs created from Crucible don't allow you to designate the Component either, your default Assignee will always by Project Lead, so you may still have a reassignment step.


Tags: fisheye-crucible-administration
How do I change password for repository in Crucible? How do I edit repository setup?
Asked by maciekskontakt:

How do I change password for repository in Crucible? How do I edit repository setup?

I see I could delete repository and create one, but that's not I want. Scanning repository from the beginning takes days and we just need to change password after reset for user account that we use for crucible reviews.

I do not see "edit" repository or at least those options that do not impact state of identification or indexing repository.


Answers:
author: gustavo_refosco
body: Hi,

You can change the password by going to **Crucible Administration \> Repositories** , click in the name of the repository to open its configuration and go to **SCM Details**.

Regards,

Gustavo Refosco


Tags: fisheye-crucible-administration
How to setup svn commit after pre-commit review is closed?
Asked by Anton:


Answers:
author: Anton
body: Ok, but is there a way to prevent svn commit if patch that is attempted to be commited is different from patch that was reviewed in fish eye?


author: gustavo_refosco
body: Hi Anton,

The pre-commit patch you upload to perform the review is made of a diff showing the difference between the version that is already in the repository and the version that is about to be committed. I suppose the person who created the patch submitted it to review, and is just waiting for approval to perform the commit, so after the review is closed and the change is approved I think it would be just a matter of having this person performing the commit.

If the person made new changes while the pre-committed change is still being reviewed I think the process would consist of having this person generating a new patch to be reviewed, so the latest changes would be reviewed before being committed.

<br />

Regards,

Gustavo Refosco


author: Anton
body: Ok. Is there a way to enfornce than that the commited svn patch is exactly same as patch reviewed in pre-commit review in fish eye?

The idea is basically same, regardless who is commiting to svn, tighly sync what's reviewed and what's commited to svn.

Thanks for your help!


author: gustavo_refosco
body: Hi Anton,

As per your lastest response, I believe you are expecting you can perform the commit within FishEye, is this correct?

If so, I'd like to inform that you actually need to just perform the commit in your repository - the pre-commit review is meant to allow you to create a patch and review it before it is committed. Once it is reviewed, you have to perform the commit directly in the repository, as FishEye doesn't write any information in your repository, it only reads from it.

Regards,

Gustavo Refosco


author: Anton
body: There is a pre-commit review in fish eye. I would like it to conclude with svn commit after all reviews are done.


author: gustavo_refosco
body: Hi Anton,Could you please explain further what you are trying to achieve? What do you mean by "setup svn commit"?Regards,Gustavo Refosco


Tags: fisheye-crucible-administration
Flyover Reports for Crucible - Latest version support
Asked by Jonathan Connolly:

I was looking into the Flyover reports for Crucible plugin and was wondering if it supported Crucible 3.7? The plugin page only stated up to version 3.5.5 but wanted to verify.


Answers:
author: Jonathan Connolly
body: Awesome, thanks!


author: Alexander Taler
body: Testing is complete and compatibility has been updated to the newest version of Crucible 3.7.1


author: Alexander Taler
body: Thank you for the question Jonathan. I will make sure there's a compatibility release very soon. Until now, there have been no issues between versions, so I anticipate it will be smooth again this time.


author: gustavo_refosco
body: Hi Jonathan,

I've tested it with version 3.7.1. After installed it's marked as Incompatible, but for me the report was generated. Crucible will point that, by being incompatible, some feature may not be available. I'm not familiar with this report to say if there's anything not working, but for me it was installed and the report was generated.

As the plugin has a free trial I'd suggest giving it a try, so you can better evaluate if it suits your needs.

Regards,

Gustavo Refosco


Tags: addon-biz.deref.flyover.flyoverforcrucible

fisheye-crucible-administration