youngmon/atlassian-qna huggingface dataset:
Advanced Field Editing - Add/Remove labels using variable smart value
Asked by Kalyan Sattaluri:

Hi All,

My usecase is this ticket - <https://community.atlassian.com/t5/Jira-Software-questions/Smart-values-for-copying-multiple-labels/qaq-p/1882892>

I have a variable {{varLabels}} which holds an array \["ABC", "DEF"\] of labels I got from parent which I need to "add" to its stories.

When I go to advanced editing and I want to **set** the labels, the syntax suggested by [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) works as expected, but when I try to **add**the labels instead, instead of individual labels, whole array gets added as 1 label.

{ "fields": { "labels": {{varLabels}} } } **\<-- works**

{ "update": { "labels": \[ {"add": {{varLabels}}} \] } } **\<-- throws an error that operation value must be a string**

{ "update": { "labels": \[ {"add": "{{varLabels}}"} \] } } **\<-- does not work, updates complete array as single label.**

I am thinking its cause the "add" method expects a single string based on documentation.. so I wanted to understand if there are any work arounds to this problem. Thanks!


Answers:
author: Bill Sheboy
body: Hi [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306)

Without seeing the specifics of your rule or audit log details...

Please review the syntax differences for *setting* versus *adding* labels with JSON, write your created variable to the audit log, and then adjust accordingly: <https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Adding-labels>

Kind regards,  
Bill

comments: author: Kalyan Sattaluri
body: Thanks Bill, using your response from [my other thread](https://community.atlassian.com/t5/Automation-questions/Converting-list-to-JSON-object/qaq-p/2551363), I was able to format my JSON to "adding" \& "removing" labels. You are AWESOME!

-----------------------------------

If my labels list were in a variable (mylabels),

**mylabels** = 124, 345, ABC

I used your suggestion to format the JSON as below

**\[ {{#mylabels.split(", ")}}{ "remove" : "{{.}}" }{{\^last}}, {{/}}{{/}} \]**

which then gave output as:

**\[ { "remove" : "124" }, { "remove" : "345" }, { "remove" : "ABC" } \]**

I then stored the output in a new variable (newVar).

Then i used advanced edit to remove the labels from the issue:

**{**   
**"update": {**   
**"labels": {{newVar}}**   
**}**   
**}**

NOTE: I tried a lot to use [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) solution from [here](https://community.atlassian.com/t5/Jira-Software-questions/Rule-for-Copy-and-Remove-Labels-to-child-issues/qaq-p/2169271) to format JSON the way he suggested but I keep getting JSON formating error. I am in Data center edition, I will keep trying that approach as well and edit this post if that route is also possible.
Converting list to JSON object
Asked by Kalyan Sattaluri:

I have a variable (**mylist**) with list such as 50810, 50811 which is populated from a web request.

I was able to convert it into an array like \["50810", "50811"\] using .asJsonStringArray

Ultimately, I want to convert it into JSON object like \[{ "mykey" : "50810"}, {"mykey" : "50811"}\] so I can update a custom multi select field.

I tried to chain asJsonObject("mykey") but it is giving me JSON as \[{ "mykey" : "\["50810", "50811"\]"}\] instead.

I am guessing I need to create a new variable and iterate over mylist and format it the way I want but I am drawing blank.

Can someone please share if what I want is possible, if so, maybe share some example of how this could be achieved.

I think this could solve my other problem of updating labels I asked here --\> <https://community.atlassian.com/t5/Automation-questions/Advanced-Field-Editing-Add-Remove-labels-using-variable-smart/qaq-p/2551263>


Answers:
author: Bill Sheboy
body: Hi [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306)

When iterating over a list, you may add additional text before or after the values...or even before / after the iterator itself.

Let's assume your list is stored as text in a variable named varMyList, with values of: 50810, 50811. And so the delimiter is ", " (a comma followed by a space).

That can be reformatted into text for use as your JSON with this:

```
[ {{#varMyList.split(", ")}}{ "mykey" : "{{.}}" }{{^last}}, {{/}}{{/}} ]
```

I recommend experimenting, writing the results to the audit log before trying an update operation, and adjusting until it works as expected. Then try the issue update to test things.

And please note: if you are trying this to support an advanced edit with JSON using the Issue Edit action, it appears the parsing does not fully evaluate smart values before trying to validate the JSON...potentially leading to errors when saving the action. The work-around for that is to first create the JSON expression in another variable, e.g., named varJson, and then using that in the edit action as {{varJson}}. This will force the smart value evaluation before the JSON validation.

Kind regards,  
Bill

comments: author: Kalyan Sattaluri
body: Thank you very much [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) I was able to "add" update a multi select field with list from variable.

As suggested, used your syntax --

**\[ {{#varMyList.split(", ")}}{ "add" : {"value" : "{{.}}" }}{{\^last}}, {{/}}{{/}} \]**

gave output: -

**\[ { "add" : {"value" : "2022-Q1" }}, { "add" : {"value" : "2022-Q3" }} \]**

which i then stored in new variable (**newVariable**).

Then I was able to edit multi select field like below:

{  
"update": {  
"customfield_14400": {{newVariable}}  
}  
}

and it worked like charm. Thank you for showing and enlightening with this syntax!!
Parent Issue Inherits User from Multi-Select User Field
Asked by Ryan Ruhland:

Hello,

I have an issue hierarchy where we have Initiatives (Parent) and Epics (Child). We have a custom field in both issue types that is Custom Field type "User Picker (multiple users)."

What I'd like to do is to use Automation so that any time a user is added to the Custom Field in an Epic, they are also added to the Custom Field in it's Parent Initiative. I don't want to copy the Custom Field from Epic to Initiative because that may not be accurate.

Example Situation:

Epic 1 currently has Users A, B, and C in Custom Field  
Epic 2 currently has Users X and Y in Custom Field

Epic 1 and Epic 2 both have a Parent Link to Initiative 100

Initiative has Users A, B, C, X, and Y in Custom Field

If I go to add User Z to Custom Field in Epic 2, I would like automation to update the Initiative Custom Field to now hold users A, B, C, X, Y, and Z.

Thank you in advance!


Answers:
author: Bill Sheboy
body: Hi [@Ryan Ruhland](/t5/user/viewprofilepage/user-id/3553627)

There are occasionally problems with the[changelog for list fields](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--) (like multiple select users), and so please try this to confirm it works...

When the rule trigger is Value Changes for *your field*, this smart value will contain the added and deleted values, respectively:

{{addedFieldChange.values}}

{{deletedFieldChange.values}}

With those, you can create a JSON update expression to edit the field: by iterating over the values. This cannot be done in a branch, but instead must be done in one single edit to prevent collisions.

<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field>

Kind regards,  
Bill


author: Erin Quick-Laughlin
body: [@Ryan Ruhland](/t5/user/viewprofilepage/user-id/3553627) This seems helpful:

[https://confluence.atlassian.com/automationkb/automation-for-jira-how-to-update-the-request-participants-or-a-multi-user-picker-field-from-the-content-of-other-fields-1216971334.html](https://confluence.atlassian.com/automationkb/automation-for-jira-how-to-update-the-request-participants-or-a-multi-user-picker-field-from-the-content-of-other-fields-1216971334.html?)  

I would imagine the job would be something like:  
\* When value changes for \<field\>  
\* Branch: for Parent  
\* Edit Issue Field, using the suggestions from the link above, and pulling source values from either the changelog or the fieldChange smartvalue - focusing on accountId.
Cannot commit, no files over 100MB
Asked by lee_runyon:

Okay, I have done the following  

1. Turned off the 100mb limit on my repo.
   1. *This did not fix the issue, don't know what the button does, but it doesn't do what it says it does*
2. Developed Script to Evaluate Git and find files \>100MB including
   1. developed scripts to evaluate currently staged files
   2. developed scripts to evaluate all files in git history
   3. developed script to evaluate all files in git commit
3. Applied BFG to remove the files from history
4. Applied LFS for the files i needed to keep
5. Rerun check scripts to confirm and validate that no files are above 100mb after cleaning.

I still cannot commit and every time it gets the following error. This is driving me totally nuts.

\`\`\`

hint: The '.githooks/pre-push' hook was ignored because it's not set as executable. hint: You can disable this warning with \`git config advice.ignoredHook false\`. Enumerating objects: 138752, done. Counting objects: 100% (138752/138752), done. Delta compression using up to 6 threads Compressing objects: 100% (59073/59073), done. Writing objects: 100% (138752/138752), 432.91 MiB \| 6.59 MiB/s, done. Total 138752 (delta 74357), reused 138611 (delta 74246), pack-reused 0 remote: Resolving deltas: 100% (74357/74357), done. remote: Your push has been blocked because it includes at least one file that is 100 MB or larger. Bitbucket Cloud recommends using Git LFS for large files to prevent repositories from growing too large and reaching the 4 GB repo size limit. Learn more about Git LFS at <https://support.atlassian.com/bitbucket-cloud/docs/manage-large-files-with-git-large-file-storage-lfs/>. If necessary, the file size limit can be disabled by an admin in Repository settings. Learn more at <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Avoid-adding-large-files>. To bitbucket.org:leerunyons/\<repo name\>\`\`\`


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

thank you for reaching out to Community!

Could you confirm if you have unchecked the option "Block pushes with files over 100MB" under the **Repository settings** of the repo you're trying to push?

![Screenshot 2024-07-18 at 5.36.02?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/336514i6D5E00E87AC93FA2/image-dimensions/512x237?v=v2 "Screenshot 2024-07-18 at 5.36.02?PM.png")

For that setting to be saved, after unchecking the option, you need to click on **Save changes**.

Would you mind trying that and let us know how it goes?

Thank you, [@lee_runyon](/t5/user/viewprofilepage/user-id/4440204) !

Patrik S


author: Nicolas Grossi
body: [@lee_runyon](/t5/user/viewprofilepage/user-id/4440204) Do you have LFS enabled ?


Tags: bitbucket-cloud

cloud
hi everyone please teach me how to push to bitbucket
Asked by Hopewell:

Hi everyone please help me push my project file to bitbucket created on vs code located in my local folder


Answers:
author: Laurie Sciutti
body: Hello [@Hopewell](/t5/user/viewprofilepage/user-id/5545285) and welcome to the Community! Have a look here for guidance: <https://support.atlassian.com/bitbucket-cloud/docs/push-code-to-bitbucket/>


Tags: bitbucket-cloud

cloud
I have added a new user to a workspace, but he has not received an invitation yet
Asked by nazeef_phonetycoon:

I have added a new user to my workspace, but he has not received an invitation yet. I saw in a response that users don't get added if you send an invitation immediately after creating a BitBucket login. But even though I sent a repository invitation a couple hours later, still haven't received an invitation mail.


Answers:
author: Patrik S
body: Hey [@nazeef_phonetycoon](/t5/user/viewprofilepage/user-id/1529009) and welcome to the Community!

I noticed you've opened a support ticket with us to investigate this issue, and one of the support engineers is already working with you on the troubleshooting. Feel free to share the outcome here once the ticket is resolved.

Thank you, [@nazeef_phonetycoon](/t5/user/viewprofilepage/user-id/1529009) !

Patrik S.

comments: author: nazeef_phonetycoon
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

Yes I have. But I haven't received a response and It's been more than 2 weeks since I'm struggling with this issue. Kindly help me out here.


author: Patrik S
body: Hello [@nazeef_phonetycoon](/t5/user/viewprofilepage/user-id/1529009) ,

I checked internally, and I see we have tried to contact you through the support ticket but haven't received a response so far. Could you check your mailbox (including the Spam folder) to see if you have received the email from support?

If not, I suggest accessing <https://support.atlassian.com/requests/>, which will list all your open support cases. Select the open ticket you have about this issue. You can then interact with support through that portal instead of using emails.

Thank you, [@nazeef_phonetycoon](/t5/user/viewprofilepage/user-id/1529009) !

Patrik S


author: nazeef_phonetycoon
body: Shows no open tickets!


author: Patrik S
body: Hey [@nazeef_phonetycoon](/t5/user/viewprofilepage/user-id/1529009) ,

Looks like your organization may be blocking Atlassian emails.

I noticed you have opened a new support ticket today. I can confirm all the previous ones were responded to, but we haven't heard back from you.

I would recommend navigating to <https://id.atlassian.com>, logging out, and then logging in again.

After that, try to access <https://support.atlassian.com/requests/> and check if the support cases are now listed (make sure the filters are set to show all support cases).


Tags: bitbucket-cloud

cloud
Using proprietary nuget package in pipeline
Asked by rajputj3@bv.com:

How can I use propriety NuGet package in pipeline similar to artifacts in devops pipeline?

Please help. Thank you so much


Answers:
author: Mark C
body: Hi [rajputj3@bv.com](/t5/user/viewprofilepage/user-id/5467490)  

Thank you for reaching out to the community.  

I believe it is possible to build NuGet package in Bitbucket Cloud.   
You can check this link that might be helpful: <https://blog.maartenballiauw.be/post/2016/08/17/building-nuget-netcore-using-atlassian-bitbucket-pipelines.html>  

Regards,  
Mark C  


Tags: bitbucket-cloud

cloud
Pipe "aws-ecr-push-image" using "ECR_PUBLIC=true" makes it mandatory to tag image differently
Asked by Nino Gresenz:

Hello Bitbucket Team,

I was trying to push an image to AWS ECR public and used the [aws-ecr-push-image pipe](https://bitbucket.org/atlassian/aws-ecr-push-image) for it.

I had some trouble to get it running as I saw the following error:

```
DEBUG: http://host.docker.internal:2375 "GET /v1.44/images/registry-alias/my-docker-image:latest/json HTTP/1.1" 404 58
? Image not found error: registry-alias/my-docker-image:latest.
```

For me it wasn't clear what I did wrong as I was using the example from the docs:

"Building and pushing the ecr-public image with default options"

```
script:  # build the image  - docker build -t my-docker-image .  # use the pipe to push the image to AWS ECR  - pipe: atlassian/aws-ecr-push-image:2.4.0    variables:      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY      IMAGE_NAME: my-docker-image      ECR_PUBLIC: "true"      PUBLIC_REGISTRY_ALIAS: registry-alias
```

Finally I've got it running after reading the [source code](https://bitbucket.org/atlassian/aws-ecr-push-image/src/485b7db7fd51118d99ad1998f4318b0b39fda626/pipe/pipe.py#lines-249) of the pipe which makes it mandatory to tag the image as follows (PUBLIC_REGISTRY_ALIAS as prefix):

```
script: 
  # build the image 
  - docker build -t registry-alias/my-docker-image .
```

Would be cool if you could change the example or leave a note somewhere in the README to avoid confusion for other people.

Cheers, Nino


Answers:
author: Igor Stoyanov
body: [@Nino Gresenz](/t5/user/viewprofilepage/user-id/5543966) hi. We updated an example you suggested in the pipe README.  

Regards, Igor


author: Ben
body: Hi [@Nino Gresenz](/t5/user/viewprofilepage/user-id/5543966)

I believe the documentation example may be intentional because **PUBLIC_REGISTRY_ALIAS** is only mandatory if **ECR_PUBLIC** is set to true.

Regardless, I've shared this feedback with our pipes team - thank you for your input :)

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: aws

bitbucket-cloud

bitbucket-pipelines

cloud

ecr

pipes
Need a sample pipeline for .NET Framework 4.8 solution (not dotnetcore)
Asked by rajputj3@bv.com:

Can someone please help me and provide me the sample pipeline to build my .NET Framework 4.8 solution project?

Thank you so much.


Answers:
author: Theodora Boudale
body: Hi,

Pipelines builds that run on Atlassian's infrastructure don't support .NET framework but only .NET Core. The .NET framework requires Windows and Pipelines currently run on Linux hosts.

For .NET Framework, you can use a self-hosted runner on a Windows server of your own:

* <https://support.atlassian.com/bitbucket-cloud/docs/runners/>
* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/>

Windows Runners use PowerShell to run pipeline steps on your Windows machine (host device). We have documentation for the several options in a bitbucket-pipelines.yml file:

* <https://support.atlassian.com/bitbucket-cloud/docs/bitbucket-pipelines-configuration-reference/>

However, the commands you use in each step's script are not some special Pipelines commands. They are commands that you should be able to execute on PowerShell. Microsoft offers the .NET CLI:

* <https://learn.microsoft.com/en-us/dotnet/core/tools/>

If you can use this CLI from PowerShell to do what you want with .NET framework, you should be able to use it in a Pipelines build with a Windows self-hosted runner, as long as the CLI is installed on the host machine.

Kind regards,  
Theodora


Tags: .net

bitbucket-cloud

cloud
Bitbucket workspace not accessible
Asked by Opteam Admin:

Hello team,

On the admin console, I am seeing a warning sign on bitbucket and not able to access the workspace and it is giving me 404 page.

<https://bitbucket.org/workspace-id>

\<screenshot removed\>


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

This workspace was deleted by another admin user, which is the reason why you cannot access it.

I'm afraid that deleted workspaces cannot be restored. You can create a new one, and if the deleted workspace had any repos, you will need to recreate them under the new workspace.

Just a heads up, I removed the screenshot and workspace id from your post for privacy reasons.

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

Kind regards,  
Theodora

comments: author: Opteam Admin
body: It did not had any repos, but I would like to use the workspace id but it is not allowing me to do so!

Is there any way I can retain that or if you can, can you tell me when it was deleted for RCA of this issue on my end?


author: Theodora Boudale
body: Hi,

The workspace was deleted on 28th June 2024 and it can take up to 30 days for the data to be removed from our system.

However, since you are an Org Admin of the Org where this workspace was linked, I have changed the id of that workspace (I just added the suffix -old to the id). Are you able to create a workspace with this id now?

Kind regards,  
Theodora


author: Opteam Admin
body: Thanks Theodora. Much appreciated.

I was able to create one with the same ID.


author: Theodora Boudale
body: You are very welcome.

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


author: Andrew Waites
body: Theodora

I have a similar problem. Looking at BB, workspace not available but I suspect (given the name) that someone else from our org looked at in the past. Is there a way to:  

a. check that it is linked to our org (or can you look at any workspaces linked or previously linked)  
b. release the name (rename to -old is fine nothing there we need)

thanks

Andrew


Tags: bitbucket-cloud

cloud
SSH key for local LAN machine: How to overcome "fetch key"?
Asked by Alexander Christian:

Hi there,

following scenario:  

I have a pipeline with a local hosted docker linux runner. Means: Each pipeline execution runs in my local network. This enables me to access non-public hosts within my LAN.   

Now I want the pipeline to access a host systm located in my LAN via SSH.  
My bitbucket repository enables me to add a SSH key by providing private and public key... But the known-hosts part is not possible, because Bitbucket (the cloud version of bitbucket) can never ever access the host on my LAN to fetch the fingerprint...  

Any ideas on what to do?   

Constraints:  
\* it is \*not\* possible, not even for a short time, to make the ssh target host public accessible to fetch the fingerprint

\* it is \*not\* possible to switch to a public reachable system. It \*has\* to be a system on my local LAN.  

<br />


Answers:
author: Theodora Boudale
body: Hi Alexander,

When you run a build, pipelines will create the file **\~/.ssh/known_hosts** in the build container. The fingerprints for the Bitbucket and GitHub sites are automatically added to that file, but you can also modify this file during the build.

Can you fetch the fingerprint of that local host during the build by adding a command like the following in your bitbucket-pipelines.yml file's script (in the step where you want to connect to that host)?

```
- ssh-keyscan hostname_or_ip_address_of_local_host >> ~/.ssh/known_hosts
```

Kind regards,  
Theodora

comments: author: Alexander Christian
body: I need to retest. Last time I tried setting up the SSH access, I was not able to save it without using the fetch-button in the UI. But this did not work due to the fact, that the SSH server is not public reachable.


Tags: bitbucket-cloud

cloud

fetch

fingerprint

lan

ssh-key
Triggering Gitlab pipeline from Bitbucket webhook
Asked by Hemanth:

Hi Everyone,

I have a bitbucket repo from where I need to trigger gitlab pipeline whenever a Merge request has been raised in Bitbucket. I have created a webhook and added gitlab api with a token access of gitlab in it. But Iam not able to achieve it. Tried to trigger jenkins through Bitbucket webhook it is working fine. Wanted to check if this way is not supported for gitlab. Please let me know any other supported workaround.

Thanks.


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

I found the following documentation from GitLab:

* <https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/bitbucket_integration.html>

I don't know if there is any other way other than what is described in this doc. Is this the one you are following?

If you have set up everything according to this doc, what you can do as a first step is check the webhook logs. We have details about this in the following knowledge base article:

* <https://confluence.atlassian.com/bbkb/troubleshoot-webhooks-1167729092.html>

You'll need to enable history for this specific webhook and then create an event that triggers the webhook. Then, check the requests in the logs:

* What status code do you see for that request?
* If you select **View details**for the request, are there any errors there?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud