youngmon/atlassian-qna huggingface dataset:
How to update child ticket fields once Parent updated
Asked by Amit Fainer:

Hello,

I am trying to create an Automation that will trigger sub-tasks specific filed change once the Parent same field was change. Example.  
Once A User story as an assignee I would like that all the sub-tasks will get the same assignee.  
Thanks


Answers:
author: Darryl Lee
body: Hi, the answer below from [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) describes how to do this in good detail:

* [Automation: Ensure All Children inherit the Epics Fix version](https://community.atlassian.com/t5/Jira-questions/Automation-Ensure-All-Children-inherit-the-Epics-Fix-version/qaq-p/1454298)

You would simply need to use a [Branch rule **For sub-tasks**](https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Related-issues) instead of **For stories** and select the field you would want to update.

comments: author: Amit Fainer
body: Thanks. It's totally make sense but not working for me. I would like to share my example.  
I have a custom filed (called FO) set on Stories, Task and SubTask.   
When create a User Story, I assign an FO (user in Jira) for it.  
The FO then create the Subtasks.  
What usually happen is that subtasks are missing the FO name, so I wanted an Automation that every new SubTask of a story or Task will get the FO name.   
Hope it is clear.  
What I was doing :  
- Condition: Set FO is not equal the FO from the Parent issue  
- Action: Edit issue Field FO (click on set) then choose "copy from parent"  


author: Ste Wright
body: Hi [@Amit Fainer](/t5/user/viewprofilepage/user-id/5144963)

Is this still not working for you?

Ste
Pipeline for Pull request
Asked by Franco Rolando:

I have this YML but when I create a PR to master , the build to check test is not automatically executed.  

```

image: maven:3.8.4-openjdk-17

pipelines:
  pull-requests:
    master:
      - step:
          name: "Run Maven Tests"
          caches:
            - maven
          script:
            - mvn -B test
```


Answers:
author: Saxea _Flowie_
body: Hi [@Franco Rolando](/t5/user/viewprofilepage/user-id/5495117)

Flowie has very [flexible support for triggering pipelines](https://flowie.app/docs/en/plugins/pipelines), including based on the destination branch.

If you have any questions, you can contact our support team, who can help you set up your workflow.


author: Syahrul
body: G'day, [@Franco Rolando](/t5/user/viewprofilepage/user-id/5495117)

Welcome to the community!

Pipeline triggers only work for the source branch and not the destination. We have a feature request that is currently tracked at:

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

In your case, the destination of the PR was the master branch, which is why there were no triggers for pipeline builds. If the master branch were the source, the pipeline build would trigger when a PR is created.

Regards,  
Syahrul

comments: author: Franco Rolando
body: Thanks! You are right! Really appreciate your comment.


Tags: bitbucket-cloud

cloud
I logged into my account and all my repositories are gone
Asked by alexanderandrewwood:

Hello

I was away for over 2 years and after logging on with my gmail account I found out that all my repositories are now gone.

why did this happen? Is there a way to get my 5 private repositories back?

Thanks


Answers:
author: Ben
body: Hi Alexander,

I can confirm that we don't remove repositories for any reason if a user has been inactive for a period of time.

Please execute the following command to locate your repository URL's and find out the workspaceID for these repositories (this is displayed before the repository name):

```
git remote -vvv
```

Once you have your workspaceID - you can access that workspace from your workspace list:

1. Click your **avatar**in the top-right corner of the screen
2. Select **All Workspaces**
3. Click on the workspace that matches the ID you found with the above command

If you don't find the workspace on this list, it is likely you have logged in using an email address that is not associated with the workspace you are trying to access - please check your git config for any email addresses you may have used in the past and log in using these instead:

```
git config --list
```

We have more information regarding this below:

* <https://confluence.atlassian.com/bbkb/workspace-has-disappeared-incorrect-workspace-loaded-1319573739.html>

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Does rescoping is done on draft pull requests
Asked by Samir Sahoo:

As far as I know rescoping is evaluated on all OPEN pull requests. Recently I came to know that Bitbucket has introduced DRAFT state and READY FOR REVIEW state.

I want to know,

1. Whether rescoping is calculated on draft pull requests?

2. Whether rescoping is evaluated on Ready for review pull requests?


Answers:
author: Syahrul
body: G'day, [@Samir Sahoo](/t5/user/viewprofilepage/user-id/5494717)

Welcome to the community!

May I know if this is for Bitbucket cloud or server? I ask because we don't have Pull request rescoping in the cloud, and any review status PR will be updated with new changes if the branch is actively being worked on.

So let me know if this is not what you were looking for, and provide more context or documentation you've followed so I can review them.

Regards,  
Syahrul

comments: author: Samir Sahoo
body: Hi [@Syahrul](/t5/user/viewprofilepage/user-id/744536)  
It's Bitbucket server. Here is the scenario:

We are facing issues like merge failure, longer merge time due to pull request rescoping.

So my question is:

1. Do we have Draft version for Bitbucket server?

2. If so, does rescoping applicable for Draft versions?

Thanks,

Samir  


author: Syahrul
body: Thanks [@Samir Sahoo](/t5/user/viewprofilepage/user-id/5494717)

Unfortunately, I am not an expert in the servers, so let me change the label of your questions to the server so the server team can assist you.

Regards,  
Syahrul


Tags: bitbucket-data-center

bitbucket-server

merge

server
Feat REST: allow Account ID to be used to update users in branch-restrictions
Asked by Sander Mol:

The current endpoint of *<https://api.bitbucket.org/2.0/repositories/>\<username\>/\<repository\>/branch-restrictions*does not allow for users to be posted by "account_id". Currently, only "username" and "uuid" is supported.

I would expect the following post body to be supported

```
{
   "type": "branchrestriction",
   "kind": "restrict_merges",
   "value": null,
   "branch_match_kind": "branching_model",
   "branch_type": "development",
   "users": [{
      "account_id": "<account_id>"
   }]
}
```

This currently results in a successful post, but without a user actually being posted. This is especially relevant now that Account ID is used in more and more places as the preferred identification field.

**Related:**

<https://community.atlassian.com/t5/Bitbucket-questions/Feat-Swagger-V3-Update-account-schema/qaq-p/2694518>


Answers:
author: Theodora Boudale
body: Hi Sander,

Thank you for the feedback. I went ahead and created a request in our issue tracker:

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

You can vote for it (by selecting the **Vote for this issue** link) 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 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.

Kind regards,  
Theodora

comments: author: Sander Mol
body: Thank you very much for creating this issue!


author: Theodora Boudale
body: You are very welcome! Please feel free to reach out if you ever need anything else!


Tags: bitbucket-cloud

cloud
Deactivated account
Asked by Clement Trebuchet:

Hello Team,

It seems that my bitbucket account is deactivated, could you help me with this?

Regards,


Answers:
author: Ben
body: Hi [@Clement Trebuchet](/t5/user/viewprofilepage/user-id/776158)

I have re-activated your workspace, I can see it was marked DORMANT as it was not logged into via the UI since 2018.

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Avoiding faulty manual triggering for Pipelines on branches
Asked by Amitav Chris Mostafa:

I want to add a conditional check on my .yml file to filter out which branched the pipelines should run on. The reason behind this being, it is still possible to manually trigger a build on a feature or bugfix branch by any user.  

script: - echo "Running on branch $BITBUCKET_BRANCH" - if \[ "$BITBUCKET_BRANCH" != "development" \] \&\& \[ "$BITBUCKET_BRANCH" != "main" \]; then echo "Pipeline execution is restricted to the development and main branches." exit 1 fi

This is my working logic.   

Why is this being overridden on manual runs?


Answers:
author: Ben
body: Hi Amitav,

Unfortunately - it's not yet possible to restrict who is able to run pipelines using the manual trigger feature. We have a feature request below that you may **Watch** for future updates and **Vote**for to improve its visibility with regard to customer demand:

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

The only preventative measures available are for Premium customers and they relate to deployments specifically - wherein deployments to certain environments may be restricted to admins only, and only for certain branches, this is not for all Pipelines in general however:

* <https://bitbucket.org/blog/deployment-permissions-now-available-in-bitbucket-pipelines>

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
PR task created from API but not showed in Bitbucket UI
Asked by Fernando Santana:

I'm creating a task in a Pull Request from the Bitbucket API using this method: <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-post>. I'm getting a 201 success response, but when I go to the Bitbucket UI, I can't see the task.  

What am I missing? or what could be the reason not to see the task in the UI?

Thanks!


Answers:
author: Fernando Santana
body: Hi,  
I have found the problem.

I was setting in the message's body  

```
{

  "content": {

    "raw": "Testing tasks from API"

  },

  "pending": true

}
```

And it should be "pending": **false** to appear in the UI  

IMHO, the meaning of "pending" is inverted  

Anyway, now it's working. \^_\^


author: Mark C
body: Hi [@Fernando Santana](/t5/user/viewprofilepage/user-id/4431945),

Welcome to the community.

May I know the status of the pull request? Is it currently Open, Rejected, or Merged?

Regards,  
Mark C

comments: author: Fernando Santana
body: Hi Mark,

Thanks.

The PR is currently open.

Also, if I use the [List Tasks in a PR](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-get) endpoint in the API, I get the task, but it does not appear in the UI.

Regards,

Fernando


author: Fernando Santana
body: Hi,  
I have found the problem.

I was setting in the message's body  
{  
"content": {  
"raw": "Testing tasks from API"  
},  
"pending": **true**  
}  
And it should be "pending": **false** to appear in the UI  

IMHO the meaning of "pending" is inverted  

Anyway, now it's working. \^_\^  


Tags: bitbucket-api

bitbucket-cloud

cloud

pull-request
Unable to login with lost 2FA
Asked by Gaurav Halnawar:

Hi Team, I have lost access to bitbucket as my phone got formatted, I don't have my recovery keys either, I use bitbucket to access all corporate repos, can someone please guide me how to request for two-step verification recovery email, any help in this regard will be highly appreciated as this is impacting my day to day work and impacting the deliverables.


Answers:
author: Theodora Boudale
body: Hi Gaurav and welcome to the community!

You will need to disable 2FA in order to access the account (you can enable it again afterwards).

2FA can be set both on the Bitbucket account and on the Atlassian account that Bitbucket uses for authentication. There are instructions on how to disable each of them here:

* <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


Tags: bitbucket-cloud

cloud
Sharing custom variables between script and after-script blocks
Asked by Pavan Prasad:

I have a step that sets variables in the script section and gets accessed in the after-script section. However I have found that variables set in the script block are not available in the after-script block. I have read that both the blocks are run in the same container. Environment variables are accessible in both blocks.  

Is it just not possible or am doing something wrong?

**Here's an example:**  
\`\`\`  
- step: \&run-variable-tests  
name: Run Variable Sharing Tests  
script:  
- export VARIABLE_1=mytestrun  
- VARIABLE_2=mytestenv-${ENV_NAME}  
after-script:  
- echo "VARIABLE_1=${VARIABLE_1}"  
- echo "VARIABLE_2=${VARIABLE_2}"  
\`\`\`  
**Output:**   
VARIABLE_1=  
VARIABLE_2=  


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

This is expected behavior. Both blocks indeed run on the same container. However, Pipelines creates a script with all commands of your step's script and runs it. Then, it creates a new script with all the commands of your step's after-script, and runs it in a new session. Therefore, any variables created during the script will not be available in the after-script.

As a workaround, you can save the export command in a file and then source the file in the after-script.

We have a feature request for defining variables per step in the yml file (this, making them available to the after-script) that you can vote for here:

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

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

Kind regards,  
Theodora

comments: author: Pavan Prasad
body: Thank you for your response, [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086). I am really looking forward to this feature being implemented. It will help make our pipeline more dynamic and simpler.


author: Theodora Boudale
body: You are very welcome, and thank you for the feedback; I see that you also left a comment on the feature request. When there is an update, it is going to be posted in that feature reuqest.

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


Tags: bitbucket-cloud

cloud
The commit could not be found in the cloned repository. This can be caused by using force push, or n
Asked by Jeyson Acero:

Hi fellas, from some weeks ago I'm receiving this error in my pipelines
>
> ```
> The commit could not be found in the cloned repository. This can be caused by using force push, or not having a deep enough clone.
> ```

Puntually, the error it's produced in the build setup of the pipeline on a git reset instruction:

> 1+ umask 000
> 2  
> 3
> + GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="develop" <https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git> $BUILD_DIR  
> 4
> Cloning into '/opt/atlassian/pipelines/agent/build'...  
> 5
> Updating files: 95% (6074/6335)  
> 6
> Updating files: 96% (6082/6335)  
> 7
> Updating files: 97% (6145/6335)  
> 8
> Updating files: 98% (6209/6335)  
> 9
> Updating files: 99% (6272/6335)  
> 10
> Updating files: 100% (6335/6335)  
> 11
> Updating files: 100% (6335/6335), done.  
> 12  
> 13
> + git reset --hard 4e5d27fc840e01987b652ea0647b19468969e742  
> 14
> fatal: Could not parse object '4e5d27fc840e01987b652ea0647b19468969e742'.  
15  
> 16

This is intermittent as it fails randomly on any branch. Also after a fail If I click rerun after some minutes it succeeds. The pipeline in question has clone depth full.


Answers:
author: Syahrul
body: G'day, [@Jeyson Acero](/t5/user/viewprofilepage/user-id/5494052)

Welcome to the community!

We have an extensive KB that outlines the specific issue which I highly suggest you review at:

[Troubleshooting Bitbucket Cloud Pipelines build with the error message: "The commit could not be found in the cloned repository. This can be caused by using force push or not having a deep enough clone"](https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-cloud-pipelines-build-with-the-error-message-the-commit-could-not-be-found-in-the-cloned-repository-this-can-be-caused-by-using-force-push-or-not-having-a-deep-enough-clone-1236937088.html)

If the suggested workaround did not resolve the issue, please raise a support ticket with us in our[Support porta](https://support.atlassian.com/contact/)l.

Regards,  
Syahrul

comments: author: Jeyson Acero
body: Hi Syahrul, thanks, I saw that article previsuly and I applied the suggestion about the depth clone, however it didn't work, I also raise a ticket in Atlassian, but I don't have a clear answer yet.


author: Syahrul
body: Hi [@Jeyson Acero](/t5/user/viewprofilepage/user-id/5494052)

Thanks for the update. It looks like our Support engineer is actively looking into it, and it appears to be related to a bug. I suggest keeping the communication in the ticket to avoid confusion.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Building an android react native app on bitbucket pipeline
Asked by Ali Osman:

Hello, I am trying to build a react native application on the bitbucket pipeline then send it to the downloads section of the repo to be available for others, However I am facing an error I can't get around/understand why it happens

Here's my pipeline

*** ** * ** ***

image: node:lts

clone:  
depth: full

definitions:  
services:  
docker:  
memory: 2048  
steps:  
- step: \&build-debug-apk  
name: Install Dependencies  
image: reactnativecommunity/react-native-android  
size: 2x  
script:  
- bash ./env-loader.sh  
- echo loaded all env variables  
- yarn install  
- yarn expo prebuild  
- ls  
- cd ./android  
- chmod +x gradlew  
- ./gradlew assembleDebug  
- curl -X POST "https://${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./app/build/outputs/apk/debug/app-debug.apk"  
pipelines:  
custom:  
release-test:  
- step:  
\<\<: \*build-debug-apk  
name: build-debug-apk  
deployment: test

*** ** * ** ***

The error happens in the gradlew assembleDebug stage  

* Where:  
Script '/opt/atlassian/pipelines/agent/build/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 435  
* What went wrong:  
A problem occurred evaluating script.  
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:  
[root:/opt/atlassian/pipelines/agent/build, reactNativePath:/opt/atlassian/pipelines/agent/build/node_modules/react-native, reactNativeVersion:0.73, dependencies:[:], commands:[], healthChecks:[], platforms:[:], project:[:]]  

any ideas ?


Answers:
author: Ali Osman
body: If this holds up anyone later down the line I found the answer to it,

I had these dependencies in my package.json

"resolutions": {  
"wrap-ansi": "9.0.0",  
"string-width": "7.0.0"  
},  
And I downgraded them to  

"resolutions": {  
"wrap-ansi": "7.0.0",  
"string-width": "4.1.0"  
},  
That solved the building issue on the pipelines


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
All my repositories gone and no workspace
Asked by TBen:

Its been a few years since Ive logged in. When checking today

I dont see any repositories or workspaces. Is this solvable?

Are unused accounts purged at some point?


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

The Bitbucket Cloud account with the same email as your community account was created just a few days ago. Do you perhaps have another Bitbucket account with a different email address? I would suggest trying to log in to <https://bitbucket.org/> with all the email addresses you own and see if any of them logs you into the account you are looking for.

There was one time when we removed accounts and that concerned Bitbucket Cloud accounts that were not associated with an Atlassian account. More details on this here:

* <https://community.atlassian.com/t5/Bitbucket-articles/Deactivation-of-user-accounts-that-lack-an-Atlassian-account/ba-p/2169213>

Other than that, we generally do not remove Bitbucket accounts because of inactivity.

Kind regards,  
Theodora


author: Dave Rosenlund _Trundl_
body: Hello, [@TBen](/t5/user/viewprofilepage/user-id/5493947). Welcome to the community ?  

According to Atlassian, "*Your products will be deactivated 15 days after your current subscription period ends. Atlassian retains data for deactivated products for 15 days for trial sites or 60 days for Free, Standard, or Premium subscriptions after the end of your current subscription period."*Lesson learned, I guess. Sorry.

Best,

-dave


Tags: bitbucket-cloud

cloud
Rest API: GET Pull Request Comments is always empty
Asked by Noha Khater:

I'm trying to retrieve all pull request comments via the rest api but the result is always empty, even though the pull request clearly does have comments.

I'm using this [endpoint](https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-pull-requests/#api-api-latest-projects-projectkey-repos-repositoryslug-pull-requests-pullrequestid-blocker-comments-get) but I don't understand how to provide a "set of field values". Simply calling the endpoint as is

```
http://{baseurl}/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments
```

returns

```
{
"size": 0,
"limit": 25,
"isLastPage": true,
"values": [],
"start": 0
}
```

What am I missing?


Answers:
author: Avinash Tingre
body: Hi [@Noha Khater](/t5/user/viewprofilepage/user-id/1877429) ,  

Are you trying to get normal comments or blocker comments (tasks)? The API you mentioned is for fetching blocker comments from the PR.  

I am able to get the response properly from the same API. But this only fetches blocker comments, not the normal comments.  

There is separate API for fetching normal comments (path is mandatory to pass):

```
curl --location --request GET 'https://{{bitbucket-host}}/rest/api/latest/projects/{projectKey}/repos/{repo-key}/pull-requests/{pull-request-id}/comments?start=0&limit=300&path=src/main/java/com/avinash/MyFile.java' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
```


Tags: bitbucket-data-center

bitbucket-server

data-center

server
Unable to login Bitbucket
Asked by knightli:

After I logged into bitbucket I got this message:  

"You may run into this issue when you use specific browsers or add-ons that hide the referer header for id.atlassian.com and other Atlassian sites. Check for these and then try logging in again."


Answers:
author: Patrik S
body: Hey [@knightli](/t5/user/viewprofilepage/user-id/5493686) ,

welcome to the Community!

I see your account was inactive due to a long period with no activity, which was causing the login to fail.

I went ahead and set it to active again, so you should be able to access it now. Could you try again and let us know how it goes?

Thank you, [@knightli](/t5/user/viewprofilepage/user-id/5493686) !

Patrik S

comments: author: knightli
body: thank you, it's ok now\~


Tags: bitbucket-cloud

cloud