youngmon/atlassian-qna huggingface dataset:
Branch Plan Auto-Merge. How to configure to happen on remote agent .vs. bamboo server
Asked by Jeff_Schaeffer:

When using the automatic merging (Gatekeeper in this case) the merge happens on the Bamboo server itself .vs. the remote agent for the plan.

Is there a way to configure Bamboo so it performs the merge on the remote agent configured with the plan?

Unless I'm seeing this wrong, automatic merging happens redundantly (twice) as it merges on the bamboo server (I'm guessing to verify it merges properly) and then moves to the remote agent and performs the same merge again. Why?


Answers:
author: Foong
body: > it merges on the bamboo server (I'm guessing to verify it merges properly)

Yes, it is merged in Bamboo server to check if there is a merge conflict. Since the Bamboo server have the repository cache, the test merge is faster in Bamboo server side instead of the remote agent.

It is also a immediate check in case of a situation when all the remote agents are busy performing other builds.

There isn't any setting to disable this merge check in Bamboo server.


Tags: merge
How to replace an artifact built by 1 branch in another, under the same build plan
Asked by Heena Agrawal:

I have 1 master plan and several branches under it. The master plan has a job task where artifacts are built using source code from the branch.

Now I want to replace an artifact that is created in branch B with the similar artifact that is created in branch A and then proceed with the other tasks. So, all in all I would have 1 artifact built by branch A and 4 artifacts built by branch B and then I will combine them together to process further.

Is there a way in Bamboo to do that without creating another master plan?


Answers:
author: Foong
body: Feature request <https://jira.atlassian.com/browse/BAM-14745>

Have to create a new master plan.

comments: author: Heena Agrawal
body: Thank You Kah!


author: Heena Agrawal
body: When I am trying to clone the master plan, here is the error that I am getting. how do I resolve this?

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

Also, The permissions tab does show that I have permission to clone the plan.

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


author: Foong
body: The missing permission is in the Project side.

The Project Admin will need to add Create Plan permission for you at **Project settings (for the related project) \> Project permissions**

[Configuring project permissions](https://confluence.atlassian.com/bamboo/configuring-project-permissions-938840042.html)


author: Heena Agrawal
body: Thank you Kah!

I was able to clone my master plan and added an "Artifact download configuration" task to share an artifact from my original plan. I named the 2 branches under both plans same so that the artifact can be shared conveniently.

However, when I try to run the branch form the plan that has the "Artifact download configuration" task, I receive the following error. Any suggestions please?

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


author: Heena Agrawal
body: Never mind. I had to run my default branch again to straighten out some issues there. After that the new cloned branch works fine and the artifacts are shared perfectly.
How to fail a deployment when msdeploy.exe Powershell script fails
Asked by christok:

We are running a Powershell task to initiate an msdeploy command as part of our standard deployment process. This accomplishes the task of pushing builds to respective environments. How, in cases when the msdeploy task fails, the deployment is still reported as successful in Bamboo. This despite the fact that msdeploy clearly reports an error in the Bamboo log.

I believe the issue is that msdeploy does not return a success or failure code. I'm wondering if others have encountered this and how they have addressed it, or if there is an alternate means of triggering msdeploy.exe without using a Powershell script.

Thanks!


Answers:
author: christok
body: The secret was to use Start-Process with -PassThru, which allowed capture of msdeploy output variables.

Found answer here: <https://stackoverflow.com/questions/33537362/how-to-check-if-ms-deploy-worked-properly/35087058#35087058>.

This script works:

$msdeploy = "C:\\Program Files\\IIS\\Microsoft Web Deploy V3\\msdeploy.exe"

$arguments = \[string\[\]\]@(  
"-verb:sync",  
"-source:iisApp='${bamboo.build.working.directory}\\\*\*\*\*\*\*'",  
"-dest:iisApp='\*\*\*\*\*\*',ComputerName='\*\*\*\*\*\*',authType='NTLM',username=''",  
"-allowUntrusted",  
"-skip:file=appsettings\\.json$")

$proc = Start-Process $msdeploy -ArgumentList $arguments -NoNewWindow -Wait -PassThru

$handle = $proc.Handle

$proc.WaitForExit();

if ($proc.ExitCode -ne 0) {  
exit 1  
}


Tags: powershell
artifacts are loaded as text files
Asked by Javier Perez:

We've upgraded to bamboo 6.8.0

**Issue**: when clicking on any artifact link, the artifact regardless its type (bin, zip, all) is uploaded in the browser as if it were a text file. For example, html files that should be naturally displayed by the browser, are displayed as text (headers, tags, etc. are not interpreted, but displayed as-they-are).

This happens with all browsers (firefox, chrome), windows or linux.

If I copy+paste the html text displayed by the browser when clicking on an html type artifact into a file and I open the file with the browser, it's correctly displayed.

**Question**: I expect to be asked where to download bin files, html files to be interpreted and displayed by the browser, like in my previous bamboo 6.6.3 version. Is this a 6.8.0 bamboo bug?


Answers:
author: Javier Perez
body: For those interested, there is a bug filed against this issue:

* [Chrome/Safari open artifacts in browser instead of download option (BAM-20305)](https://jira.atlassian.com/browse/BAM-20305)

The issue also suggests the following **workaround**:
> Enable the option "Resolve artifacts content type by extension" at Administration \>\> Security \>\> Security settings


Tags: bamboo-administration
Docker Runner Credentials Passing Best Practices
Asked by Sean Feeney:

Can anyone suggest a best practice for passing AWS credentials to a Docker Runner? Or really any way to pass sensitive variables short of baking them into your Docker image?


Answers:
author: Sean Feeney
body: For anyone stumbling across this, [Bamboo variables](https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html "Bamboo variables") are available to Script tasks in a Docker Runner.


author: Steffen Opel _Utoolity_
body: Thanks for sharing your findings! In terms of security best practices, given your usage of AWS, allow me to also suggest a more secure alternative for handling AWS credentials and other sensitive variables in Bamboo with two AWS focused apps:

* **Disclaimer**: I'm a co-founder of these app's vendor Utoolity.

**Identity Federation for AWS (Bamboo)**

Rather than persisting long-term AWS credentials as global or plan variables, our (commercial) [Identity Federation for AWS (Bamboo)](https://marketplace.atlassian.com/apps/1212482/identity-federation-for-aws-bamboo) app provides an [AWS Credentials Variables task](https://utoolity.atlassian.net/wiki/spaces/IFAWS/pages/42434587/Using+the+AWS+Credentials+Variables+task+in+Bamboo) that allows to inject variables with temporary AWS credentials for reuse in subsequent tasks, e.g. the [Bamboo Script task](https://confluence.atlassian.com/bamboo/script-289277046.html) you seem to use, here's an example:

* [How to provide temporary AWS credentials to the AWS Command Line Interface (AWS CLI) via Bamboo variables](https://utoolity.atlassian.net/wiki/spaces/UAAKB/pages/43515961/How+to+provide+temporary+AWS+credentials+to+the+AWS+Command+Line+Interface+AWS+CLI+via+Bamboo+variables)

**Tasks for AWS (Bamboo)**

Rather than persisting secrets and configuration data as global or plan variables, our (commercial) [Tasks for AWS (Bamboo)](https://marketplace.atlassian.com/apps/1211585/tasks-for-aws-bamboo) app provides an [AWS Systems Manager Parameter task](https://utoolity.atlassian.net/wiki/spaces/TAWS/pages/577306705/Using+the+AWS+Systems+Manager+Parameter+task+in+Bamboo) that allows to inject variables with [SSM secure string parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-about.html#sysman-paramstore-securestring) (and also [AWS Secrets Manager secrets](https://docs.aws.amazon.com/systems-manager/latest/userguide/integration-ps-secretsmanager.html)) for reuse in subsequent tasks:

* [Using the AWS Systems Manager Parameter task in Bamboo (Get Parameter)](https://utoolity.atlassian.net/wiki/spaces/TAWS/pages/577306705/Using+the+AWS+Systems+Manager+Parameter+task+in+Bamboo#UsingtheAWSSystemsManagerParametertaskinBamboo-GetParameter)

Both tasks ensure that no sensitive information is persisted in Bamboo and instead retrieved at task execution time so that secrets can be securely managed in AWS and any access is automatically audited via AWS CloudTrail.
JGit depreciated??
Asked by ALMH:

Hi,

I read that JGit is depreciated from Bamboo 6.8.

Refer : <https://confluence.atlassian.com/bamboo/bamboo-upgrade-guide-720411366.html>

1. What is the impact of this?
2. Is there a way to find if JGit is used in our Bamboo or not?


Answers:
author: Alexey Chystoprudov
body: It means in future versions of Bamboo it will require Git command line client available at server and agents

comments: author: ALMH
body: Thanks Alexey.

Is there a way to get a list where JGit is used in our Bamboo or agnents?


author: Alexey Chystoprudov
body: If agent and server have system.git.executable capability then it means JGit is not used


author: ALMH
body: Thankyou.
Why aren't my Bamboo automated test results updating in my JIRA Test Plan anymore?
Asked by Joseph Griffin:

I have automated test plans running in Bamboo that have previously updated the JIRA test execution results linked to that automated test plan. The JIRA Test Plan and Execution Results have stopped updating with the most recent Bamboo results.


Answers:
author: Foong
body: Do you mean Jira Issue Development Panel isn't showing the latest build result?

Is the same issue showing the build result from old builds?

Does the problem happens to specific Jira project or Bamboo plan only?


Tags: jira
How to update the Bamboo BAMBOO-SSH-PROXY: after moving your Bitbucket instance
Asked by Josh Cormier:

Before all this started Bamboo was configured correctly and working.

Our Bitbucket instance has been moved to a different server with a DNS entry and IP address.

I have re-linked the repositories but when I try to build I get and error and see the following line in the log file, still referencing the old Bitbucket address. Is there something I missed modifying in Bamboo that needs to be updated to reflect this new address?

```
BAMBOO-SSH-PROXY: [SSH proxy tried to connect to [git@bitbucket.etchdev.mydomain.net/167.191.52.70:7999]: and failed due to the following error: [Error while opening SSH session]: org.apache.sshd.common.RuntimeSshException: Failed to get the session.]fatal: Could not read from remote repository.
```

git@bitbucket.etchdev.mydomain.net/167.191.52.70:7999 **should read** 10.115.235.23:7999

Is the BAMBOO-SSH_PROXY info stored in a file on the Bamboo server?


Answers:
author: Foong
body: Is Bitbucket Server using the hostname "bitbucket.etchdev.mydomain.net"?

If the hostname have been changed, is the Base URL or SSH Base URL updated at **Bitbucket Server Administration \> Settings \> Server settings** ? After updating this setting, all the Bitbucket Server repositories in Bamboo have to be re-saved again.

comments: author: Josh Cormier
body: Thanks, yes the Host name was changed to be correct and I re-saved the repos. That did not work.

What solved the issue was manually removing the cache folder and restarting Bamboo.


author: Foong
body: <https://javaeesupportpatterns.blogspot.com/2011/03/java-dns-cache-reference-guide.html>


author: ondrej_lerch
body: [@Josh Cormier](/t5/user/viewprofilepage/user-id/1994896) Which cache folder exactly did you delete? Did you restart Bamboo Server or Bamboo Agent? We are strugling with the same issue. Thanks for your feedback.


author: ondrej_lerch
body: Finally we solved the problem too. What helped us was to specify SSH base URL, not leaving it empty, then to re-save the repos in Bamboo GUI and delete git repository caches on Bamboo Agents.
How Bamboo server encrypts password when entered in DeployOnTomcat Task
Asked by Deepali W:

I am using Bamboo Spec v6.8 to create Plan and task to checkout, maven build and deploy on remote Tomcat server using following way:

```
Task deployTask = new AnyTask(
new AtlassianModule("com.atlassian.bamboo.plugins.tomcat.bamboo-tomcat-plugin:deployAppTask"))
.description("DeployOnTomcat")
.configuration(new MapBuilder().put("appVersion", "").put("tomcatUrl", MY_TOMCAT_URL)
.put("warFilePath", MY_WAR_FILE_PATH)
.put("tomcatUsername", MY_TOMCAT_USER).put("deploymentTag", "")
.put("encTomcatPassword", MY_TOMCAT_PASSWORD)
.put("appContext", "/" + jobDetails.getProjectName().trim().toLowerCase())
.put("tomcat6", "").build());
```

Here problem is I need to pass encrypted password in MY_TOMCAT_PASSWORD place.

How do I encrypt it? I suppose Bamboo uses Base64 to decode it.

When I use java.util.Base64 to encode password it returns value which is not working on bamboo to deploy app on tomcat and gives error like:

```
error?? 27-Feb-2019 09:46:47?? Error occurred while running Task 'DeployOnTomcat(3)' of type com.atlassian.bamboo.plugins.tomcat.bamboo-tomcat-plugin:deployAppTask.
error?? 27-Feb-2019 09:46:47?? com.atlassian.bamboo.security.EncryptionException: Failed to decrypt.
error?? 27-Feb-2019 09:46:47?????????? at com.atlassian.bamboo.security.EncryptionServiceImpl.decrypt(EncryptionServiceImpl.java:72)?
.....
.....
error?? 27-Feb-2019 09:46:47?? Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
error?? 27-Feb-2019 09:46:47?????????? at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:936)
error?? 27-Feb-2019 09:46:47?????????? at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:847)
error?? 27-Feb-2019 09:46:47?????????? at com.sun.crypto.provider.DESedeCipher.engineDoFinal(DESedeCipher.java:294)
error?? 27-Feb-2019 09:46:47?????????? at javax.crypto.Cipher.doFinal(Cipher.java:2164)
error?? 27-Feb-2019 09:46:47?????????? at com.atlassian.bamboo.security.EncryptionServiceImpl.decrypt(EncryptionServiceImpl.java:70)
```


Answers:
author: Daniel Santos
body: Hi [@Deepali W](/t5/user/viewprofilepage/user-id/2497724)

Each Bamboo instance will have a different encrypted result for the same password. It depends on the instance encryption keys.

At the moment we are missing a REST API to generate the encrypted data you need in your specs project. There is a feature request for this at [\[BAM-20131\] Rest API endpoint to encrypt variables content.](https://jira.atlassian.com/browse/BAM-20131)

As a **workaround**:

1. Go to a Bamboo plan, add the **Tomcat Deploy task**
2. Fill the minimum task details (and the needed **password**)
3. Save the task
4. Click in **Plan configuration** than in **Actions \>\> View plan as java specs**
5. Then copy the **encrypted password**generated

I hope that can help you while the endpoint is not available.


Tags: spec
Moving a plan to a new project through the REST API
Asked by Starkey DevOps:

I know that through the GUI, its completely possible (<https://confluence.atlassian.com/bamboo/moving-plans-to-a-different-project-289277189.html>) but I can't see anyway through the REST API to accomplish this.

TFYT


Answers:
author: Daniel Santos
body: Hi [@Starkey DevOps](/t5/user/viewprofilepage/user-id/39321)

You are not able to find a way because there is no REST API endpoint for that in Bamboo. You will need to use the UI.  

I've created a feature request to create an endpoint for this as you can see here: [\[BAM-20325\] Create a REST API endpoint to move plans.](https://jira.atlassian.com/browse/BAM-20325)

In case you want to know how we prioritize and decide what to implement from our backlog, please check [Implementation of New Features Policy - Atlassian Documentation](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).
URL for Bamboo application link
Asked by Chris Isaacson:

What is the best URL format to create an application link between Bamboo and a bitbucket.org account?

I tried [https://bitbucket.org/myorganization/](https://bitbucket.org/myorganization/?) but only got to the manual setup page were I had to enter unknown Oauth2 settings.

Trying [https://bitbucket.org/myorganization/myproject/src/master/](https://bitbucket.org/myorganization/myproject/src/master/?) complained about a redirect before the Oauth2 page.

Is there a clean solution here?


Answers:
author: Daniel Santos
body: Hi [@Chris Isaacson](/t5/user/viewprofilepage/user-id/2579804)

We don't actually use application links for communication between Bamboo and Bitbucket Cloud, although do use for Bitbucket Server.

This is how you can configure your linked repository from Bitbucket Cloud:

* [Linking Bitbucket Cloud source code repositories- Atlassian Documentation](https://confluence.atlassian.com/bamboo/bitbucket-cloud-289277000.html?_ga=2.45264292.1845547805.1551111816-499457697.1543430345)

Let me know if you can get it working.
Docker Bamboo - building and testing Windows-only .Net
Asked by Abe Gillespie:

I'd like to run a Bamboo container to build and test locally. The project is .Net 4x, not .Net Core; so it's Windows-only. The Bamboo Docker Image is Linux. I can't see how the Bamboo container can work in this scenario. Is there something I'm missing?


Answers:
author: Marty
body: Hi Abe,

I am not on the Bamboo team but will try to help.

Just to clarify - are you trying to run Bamboo inside a Docker container?

Or do you want to spin up a Docker container as part of the build-and-test cycle of an existing bamboo server?

If the former, you're right that the provided Docker images are based on ubuntu.

I am neither a Windows nor a Docker expert, but I don't see any reason why you can't create your own Dockerfile to construct your own image that will run bamboo on top of windows.

First you'll need to create a Dockerfile based on windows: <https://www.docker.com/products/windows-containers>

Then you'll need to create a Dockerfile that does the equivalent to the Bamboo for Windows installation steps: <https://confluence.atlassian.com/bamboo/installing-bamboo-on-windows-289276813.html>

NB: sometimes the community site does strange things to links. If you get a 404 for a link please copy-and-paste the link into your browser.

I hope that helps!

comments: author: Abe Gillespie
body: Ah, right, good idea. I can use the existing Dockerfile as a place to start. Hopefully the windowsservercore image is an appropriate base image for this.

Thanks for the help.
Links at the top of a JWM form do not open in a new window/tab
Asked by Michael Osinibi:

Hi there,  

I'm currently trying to open a link in a new window/tab located above the Jira Work Management form. However, I've encountered some difficulty in achieving this using HTML. It seems there are no options available to set the link to open in a new window/tab.

Could someone assist me with this? I have also attached a screenshot.  

Thanks in advance for your help.  

Best regards,   
Michael

<br />

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


Answers:
author: Alper Saglam _actioner_
body: Hi [@Michael Osinibi](/t5/user/viewprofilepage/user-id/5063707)   

is your problem continuing? Because when I try to create a form and attach it into a request type the link that I created is opened in a new window.   

see the [video](https://www.loom.com/share/b77b221054f041418bb94ab1b1f21948?sid=5daec6d1-46ea-4d68-8f77-f972342a8e3f) link is opened in a new tab.  

and also this is my form configuration (nothing special)  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/322301iABD4416C7D6AE090/image-size/large?v=v2&px=999 "image.png")

comments: author: Michael Osinibi
body: Thank you Alper! I appreciate your response. The video showed me that it can be done but can you show me a recording within the author mode of how you created the link to open up in a new window? My attempts just open up in the same window. I can't even write a html code to create it.


Tags: jira-service-desk-cloud

jira-service-management

jira-service-management-cloud
how to validate if user is a part of a group
Asked by Arunajyothi Samala:

Hi

I have two groups.

First group: if a user from first group is creating the JSM ticket, no validation, go and ahead and create the issue

Second group: if the user is from second group, show a custom field with group of users in it. Make it required. then submit the ticket.  

I am new to scriptrunner.

1. Do I have to use a Validator or should I a use scriptRunner behaviour to acheive this?


Answers:
author: Peter-Dave Sheehan
body: Hi and welcome to the wonderful world of scriptrunner!

Let's clarify some components of Jira/Scriptrunner.

1) Workflow Validator: whether provided by native Jira functionality, scriptrunner, or any other add-on, workflow validators execute AFTER the user clicks submit on a transition screen but before anything is saved.

2) Behaviours: can be executed any time an issue screen is displayed (creation, edit, or transition screens). This can be used to validate user entries or otherwise adjust elements on the screen based on user input. Note that fields have to be present on the screen for behaviours to do something to it. A field can be hidden (or not). But a new field can't be added.

Similarly, behaviours can make a field required when it is not otherwise set as required by the field config or the workflow. But it cannot make it optional if it is required by those other components.

So since your requirement is to "Show" a field when a user is part of group 2, what we really need then is to HIDE it when the user is NOT part of group 2. This can be accomplished with a behaviour script.

Because your requirement is not dependent on another field being modified, then the best place to put this logic is in an "initializer" script. This script runs when the screen initially opens.

Here is a sample script to get you going in your behaviour journey:

```
def conditionalCustomFieldName = 'Your custom field to show'
def groupToShowFieldTo = 'group 2'

def currentUser = Users.loggedInUser

def behaviourFormField = getFieldByName(conditionalCustomFieldName)
def showField = currentUser.isMemberOfGroup(groupToShowFieldTo)
behaviourFormField.setRequired(showField).setHidden(!showField)
```

This presumes that your custom field exists, is on the screen, and is not required by Jira configurations. Also, that field must already be configured to allow the correct type of input. s


Tags: data-center

jira-service-management

jira-service-management-data-center