youngmon/atlassian-qna huggingface dataset:
Bamboo Plugin Development: Get username of user who triggered build in custom NotificationTransport
Asked by Daniel Marthaler:

Can anybody tell me how I can get the username of the user which triggered the build (manual or via code changes) when implementing a custom NotificationRecipient and NotificationTransport?

Thanks


Answers:
author: Jobin Kuruvilla [Adaptavist]
body: In the notification listener, you can get the build key, build number etc and then use it to retrieve the ResultsSummary. From the [ResultsSummary](https://docs.atlassian.com/bamboo/latest/com/atlassian/bamboo/resultsummary/ResultsSummary.html), you can get a. lot of information on what caused the build, who triggered it, details of commits etc.


Tags: bamboo-app

bamboo-development

developer
REST API: How to deploy a build
Asked by comodmw:

**How can i deploy**

* **"Create new release from build result"**
* **"Promote existing release to this environment"**

**...via REST API?**

-----

Im Using <https://github.com/sebarmeli/bamboo-api> (bamboo-api "framework" in nodejs) - unfortunatelly there are no functions implemented for deploayment...

In other posts ive seen that there are some steps needed to be done in advance. one of them was

/rest/api/deploy/projectVersioning/"+lastBuildResultKey+"/nextVersion.json

but everthing i try fails.

is there maybe another js or php framework available for bamboo!?


Answers:
author: somethingblue
body: Hi Michael,

Have you seen the Bamboo REST API documentation? There is a link to the following call and a description of it's use:

### [/deploy/project/{deploymentProjectId}/version](https://docs.atlassian.com/bamboo/REST/5.11.0/?_ga=2.28686015.2056815034.1502114943-39342300.1501512564#d2e1302) {#d2e1302}

I would try that and see if that works for you.

Cheers,

Branden
Bamboo Docker Push fails
Asked by Vlad Budica:

Hi guys,  

I am doing a docker push build step and I get the following error:  
error 04-Aug-2017 14:49:37 Caused by: com.atlassian.utils.process.ProcessException: Error executing '/usr/bin/docker login -u vlad -p \*\*\*\*\* -e vlad@gmail.com', exit code: 125  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.process.DefaultDockerProcessService.execute(DefaultDockerProcessService.java:53)  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.process.DefaultDockerProcessService.executeSilently(DefaultDockerProcessService.java:63)  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.executeSilently(DockerTaskProcessService.java:75)  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.client.DockerCmd$AuthorisedCommand.login(DockerCmd.java:346)  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.client.DockerCmd$AuthorisedCommand.execute(DockerCmd.java:311)  
error 04-Aug-2017 14:49:37 at com.atlassian.bamboo.plugins.docker.client.DockerCmd.push(DockerCmd.java:238)

The docker login command doesn' t have a -e option and that generates the issue.  

Do you have any suggestions?  
Is this a bug ?  

Thanks,  
Vlad


Answers:
author: Steffen Opel _Utoolity_
body: The [-e and --email flags](https://docs.docker.com/engine/deprecated/#-e-and---email-flags-on-docker-login) flags have been removed from Docker engine as of release 17.06, so presumably the Docker CLI on your agents is a more recent version.

I don't know off hand how the [Bamboo Docker task](https://confluence.atlassian.com/bamboo0515/configuring-the-docker-task-in-bamboo-894237426.html)handles this, but given that all fields are optional because you can *"Leave these credentials empty to use the agent's \~/.dockercfg credentials"* (which would also be a workaround accordingly), it *might* just do the right thing and skip the -e flag when you don't specify an email address.

comments: author: Vlad Budica
body: Hi Steffen,  

Thanks for your reply.  
Could you give me the exact path to the dockercfg file ?  
It's now clear what is the agent's home dir. I have only one agent so the path would be bamboo-home/atlassian-bamboo-6.1.0/.dockercfg ?


author: Alton Washington
body: Hi Vlad we are facing same issue. Were you able to use a workaround.


author: John Gill
body: Great solution here, sadly Email is not optional for all Docker plugin version. I'm currently dealing with this in Bambo 6.1.


author: Vlad Budica
body: Hi Alexey,  

Thanks for your reply we will se if we still need this functionality.  

Thanks,  
Vlad


author: Alexey Chystoprudov
body: Hello [@Vlad Budica](/t5/user/viewprofilepage/user-id/1144033),

It's known issue <https://jira.atlassian.com/browse/BAM-18613> which is fixed in Bamboo 6.2.0 planned for release end of September.

You can try updated version of docker plugin from <https://bitbucket.org/atlassian/bamboo-docker-plugin/downloads/> for older versions of Bamboo, but we not guarantee it is 100% compatible
Sharing plan artifacts BAMBOO
Asked by Pawel Zwierzchowski:

Hi,

I've got two plans on Bamboo: X and Y.

X plan is a builder of my app and Y - visual tests. For now Y is a child of X and it runs after X finish. X creates an artifact (app.zip), after thay Y download that packahge as a artifact. Y creater an artifact (report.zip). Can I use that artifact (report.zip) in summary of build X?

build X fiinish-\> app.zip -\> build Y finish -\> report.zip -\> info about report.zip in X summary


Answers:
author: Jeyanthan I
body: You can share artifacts between different build plans. You just need to use the 'Artifact downloader task' to do so.

More details can be found in the [Sharing artifacts documentation](https://confluence.atlassian.com/bamboo/sharing-artifacts-359400060.html).

Hope that helps.

comments: author: Pawel Zwierzchowski
body: Can I share artifact from build Y to build X? Build Y before start needs a completed X build...


Tags: artefact
Bamboo remote agents for test and release
Asked by Brent Bae:

I'm think of having multiple virtual machines on Azure cloud.

So my plan is having a bamboo server only build the project. After build process it deploys to other two virtual machines for testing(let's say one for UAT and the other for performance testing)

After finishing the test , bamboo should be able to release the project to the production virtual machine.

With this scenario, is it correct that i need to purchse license for 3 remote agents?

Also I heard that there is plugin called "virtual agent for Bamboo". can it be used with Azure cloud? And how can i utilize the plugin so that i can reduce the license cost?.

Thank you


Answers:
author: Christian Glockner
body: Hi Brent,

Bamboo's remote agent licenses are counted against online agents only. In your case it sounds like there would be one local agent (on the Bamboo server) and two remote agents (spun up on demand), so you'd end up with no more than two online remote agents at any one time.

The smallest license that gives you more than one remote agent is a 5-agent license.

Cheers,

Christian  
Premier Support Engineer  
Atlassian

comments: author: Brent Bae
body: Thanks for the reply,

So you're saying I need only two remote agents license for test but not need for deployment to produciton virtual machine. correct?

But virtual machine for production is sepearted from the bamboo server. is it still doesn't count as a remote agent?


author: Christian Glockner
body: Hi Brent,

Can you elaborate what you mean with "deploy to production virtual machine"?

Cheers,

Christian

Premier Support Engineer

Atlassian


author: Brent Bae
body: Maybe I mixed with the term "deploy" and "release". sorry about confusion.

You can think of production virtual machin as production server and bamboo server is serperated from productions server.

So after bamboo finishing building and testing, it should be able to connect to production server in order to release the project to production server.

hope this clear things up


author: Christian Glockner
body: Hi Brent,

Ah yes, that makes things clearer. Actually you might even be able to run this on just the local agent on the Bamboo server, depending on the requirements of your tasks.

For instance, if your Bamboo server is running on Linux, but you'll be building Windows code, you won't be able to do that without a remote agent running on Windows. However if you don't have any requirements that your local agent won't be able to satisfy, then you should be able to get by with just the local agent.

Keep in mind though that this will extend the time it takes to run your build since all tasks are executed in sequence since there's only one agent. If you have multiple agents (local or remote), some of them may run in parallel, depending on how your plan is set up.

In general, think of agents as workers that just execute whatever jobs you give them. Pushing code to a remote machine doesn't need a remote agent per se at all.

Is that any clearer?

Cheers,

Christian

Premier Support Engineer

Atlassian


Tags: licence

remote-agent
"Unable to create URL - please check your web repository configuration" with GitHub repos
Asked by Philip Colmer:

When looking at the results of a build, Bamboo lists the revisions for each of the repositories but it only produces a link for the repository held on BitBucket.

For the repositories held on GitHub, I get the above message when I hover over the commit reference.

Looking under web repository, the only option I seem to have is to pick Fisheye, but we don't have that running.

Why can't Bamboo generate a link that goes directly to the GitHub commit?

Is there a solution to this? Am I missing a configuration setting or a plugin?


Answers:
author: Philip Colmer
body: After posting the question, it looks like <https://community.atlassian.com/t5/Bamboo-questions/Bamboo-not-linking-a-build-s-commit-back-to-GitHub/qaq-p/462208> might contain a helpful answer - will test!

comments: author: Philip Colmer
body: No, despite the original question matching my needs, the answer provided doesn't solve the problem.
Is it possible for Bamboo to create a branch when a build fails?
Asked by Young Kwang Kim:

Hi, I use

- Bamboo 6.0 (hosted on a 64-bit Windows 10 machine)

- Git 2.13

- SourceTree 2 (I use GitFlow plugin)

- Git remote repository: Bitbucket Cloud and GitLab with Git LFS 2

- Visual Studio 2017 for C++ Win32 applications

This is a scenario that I want;

1. Bamboo checks the Git remote repository and pulls the latest commit.

(Most of the commits are pushed to the develop branch.)

2. **If a build fails, a branch is created from the latest commit and it is pushed to the remote repository.**

For instance, Bamboo detects a failed build after polling the commits from GitLab or Bitbucket. Then, Bamboo creates "BAM-PROJKEY-101" branch and pushes it to the remote repository so the developer can pull the branch to solve the problem.

3. The developer commits codes to the newly created branch and merges it back to the develop branch.

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

**In short, Is this branch creating feature possible with Bamboo 6 when using remote repositories such as Bitbucket Cloud / GitLab / SVN / Perforce?**

-Best regards, Young Kwang, Kim


Answers:
author: somethingblue
body: Hi Young,  

One way to go about this would be to use [How to commit to a Git repo during a build](https://confluence.atlassian.com/bamkb/how-to-commit-to-a-git-repo-during-a-build-720641378.html) or [How to push to repository under SSH protocol using Script task](https://confluence.atlassian.com/bamkb/how-to-push-to-repository-under-ssh-protocol-using-script-task-747831642.html) to create the branch as part of a script task the same way you push changes you should be able to push a new branch, however, if you don't know yet whether it's going to fail you'll probably have to create the script task as a final task  
so that task will run no matter what.

In that regard you will also have to create some sort of condition, like a semaphore, that will tell the script GO or NO-GO based on that condition and before the build is actually finished.

There may also be another way to accomplish this, but rather complex..   

You're using Bamboo 6 and can make use of a dark feature called "Final Stages".. it's similar to the Final Task, but for a Stage instead... it will run no matter what - the interesting part with Final Stages is that you could call the following REST endpoint using a Script task http://localhost:8085/rest/api/latest/result/PROJ-PLAN-\<BUILDNUMBER\>?expand=stages.stage to capture the state of each stage that finished before the "Final Stage"..

If everything is successful don't trigger the script that will create and push the branch to the repository, if any of the stages failed (meaning a job failed, meaning the build will fail), then kick off the script to create the branch   
RE \<BUILDNUMBER\> and you can use the Bamboo variables at runtime to get the number of the current running build.  

It's not as simple as using Final Tasks but it's another possibility.  

Hopefully that points you in the right direction!  

Cheers,  

Branden


Tags: bitbucket

git
'mvn' is not recognized as an internal or external command, operable program or batch file. ?
Asked by poovaraj:

Hi Team,

I have installed Bamboo in server machine and have set maven path to system environment varaible in server. I am getting below error message while running job from another machine (client machine). Could you pleae help me to resolve this issue.

Error Message :

C:\\testing\\bamboo-home\\xml-data\\build-dir\\FOMS-TES-JOB1\>mvn clean install  
**'mvn' is not recognized as an internal or external command,**   
**operable program or batch file.**   
**Failing task since return code of \[MavenBatch.bat\] was 1 while expected 0**   
Finished task 'Automation Testing Demo' with result: Failed  
Running post build plugin 'NCover Results Collector'  
Running post build plugin 'Artifact Copier'  
Running post build plugin 'npm Cache Cleanup'  
Running post build plugin 'Clover Results Collector'  
Running post build plugin 'Docker Container Cleanup'  
Finalising the build...  
Stopping timer.  
Build FOMS-TES-JOB1-32 completed.  
Running on server: post build plugin 'NCover Results Collector'  
Running on server: post build plugin 'Build Hanging Detection Configuration'  
Running on server: post build plugin 'Clover Delta Calculator'  
Running on server: post build plugin 'Maven Dependencies Postprocessor'  
All post build plugins have finished  
Generating build results summary...  
Saving build results to disk...  
Logging substituted variables...  
Indexing build results...  
Finished building FOMS-TES-JOB1-33.


Answers:
author: Nic Brough -Adaptavist-
body: The enviornment in which the build is running does not have an execution path that includes your maven installation. In other words, your "set maven path to system environment varaible in server" has not been done correctly

comments: author: poovaraj
body: Thanks for your reply !

* I have set maven path to system environment variable in bamboo installed server but I don't know how to set maven execution path ?
* I have bamboo admin role but unable to see execution path option in bamboo tool ? What is the user role required to set execution path ?
* How to set maven execution path in bamboo server ?


author: Nic Brough -Adaptavist-
body: You've said you've set the system in the installed server - that should be it. I'd say you've made a mistake in that somewhere.
Example usage of jython on Bamboo Configuration as Code
Asked by Gustavo Panizzo:

Hello

i'm using a build plan to create more build plans using bamboo's configuration as code. so far so good.

what we're doing can be seen here

<https://github.com/gfa/bamboo-plans>

I want to improve this

99% of our plans do the same steps to test and build the code, but since is java code and we don't have any expertise on java we have one directory for each plan, duplicating the same code over and over.

I took a look at jython, or simply trying to make a general class using java and taking parameters but TBH i don't even know where to start.

Does anybody has anything better they can share?

thanks!


Answers:
author: Enrique Ramirez
body: Hi Gustavo,

I am starting to use Bamboo as code. We are currently looking at jython. We are keeping as simple as a Main program that takes as argument a input file. The file describes the plan in english and the script parses the information and calls the Spec api to do the heavy lifting. Because we only have a handful of plans; the need for making the jython script modular is not need it.

Best of luck

Enrique


Tags: configuration

jython
Bamboo database: can I use an Azure SQL Database?
Asked by Jay Godse:

I am currently evaluating Atlassian Bamboo. At some point soon, I will upgrade to the paid version soon. I would like to use an Azure SQL Server database as the database for my Bamboo implementation. Is that possible? Do I have to give Bamboo more than a connection string to give it to access the database?


Answers:
author: somethingblue
body: Hi Jay,

Unfortunately SQL Azure is not yet a supported database for Atlassian products. I see that other products already have feature requests for this, but not Bamboo. There is a feature request that you can find at [BAM-16517.](https://jira.atlassian.com/browse/BAM-16517.)

I suggest that you vote on this request and you'll be notified of any changes to the ticket such as updates, etc., but for the time being, please refer to the [supported platforms](https://confluence.atlassian.com/display/BAMBOO/Supported+platforms) documentation for database types and versions you can use with Bamboo.

In addition, [AWS is supported](https://community.atlassian.com/t5/Bamboo-questions/Can-bamboo-launch-VM-on-Azure/qaq-p/421770) if that is an alternative for you.

Cheers,

Branden

comments: author: Jay Godse
body: Thanks. I'll use a local database. And I'll keep an eye on this feature request.


author: Massimo Mirabito
body: Any idea when the feature will be offered. we just tried it and it comes back that it's not supported.

max


Tags: azure
Trigger job only when new file is placed in a folder
Asked by elac16:

We have a project which doesn't use version control tool. Developers will place the input files in the shared drive folder. Bamboo has to trigger the deployment plan only when new files are found in that location. It should be like Polling repository. Bamboo has to check the folder every 10 mins and triggers a job if new file is found. Is there a way to achieve this trigger in Bamboo?


Answers:
author: somethingblue
body: Hi Elavarasan,

This isn't possible by default but you could build ascript (outside Bamboo) to look for changes in that folder and trigger a REST call to Bamboo to fire off a build if there's a change every 10 minutes.

Here is a guide to the [Bamboo REST API documentation](https://docs.atlassian.com/bamboo/REST/6.0.0/) to get you started! In addition, here is a Sample script provided by one of the Bamboo Premier Support Engineers:

```
#!/bin/bashCOUNTER="COUNTER.txt"DIRECTORY_COUNT=$(ls -lr | wc -l)if [ ! -f $COUNTER ]; then    # create counter file    # used to store the amount of files/directories within a directory    echo $((DIRECTORY_COUNT+1)) > $COUNTERfiCOUNT=`cat $COUNTER`if [[ "$COUNT" -lt "$DIRECTORY_COUNT" ]]; then    # new file/directory was created    echo "$DIRECTORY_COUNT" > $COUNTER    # replace BAMBOO_ADMIN_USER with Bamboo administrator username    # replace BAMBOO_ADMIN_PASS with Bamboo administrator password    # replace http://localhost:8085 with Bamboo's Base URL    # replace PROJ-PLAN with planKey that should be triggered    curl -k -u BAMBOO_ADMIN_USER:BAMBOO_ADMIN_PASS \         -X POST 'http://localhost:8085/rest/api/latest/queue/PROJ-PLAN'fi
```

P.S. You must make the script executable.

The above script is for Linux/OS X, however, that should help you get started. You will need to make sure you use the correct system calls, etc. for Windows. To make it platform agnostic you may want to consider using Python to create the script.

In addition, I would also recommend you create a Suggestion on [JAC](https://jira.atlassian.com/secure/Dashboard.jspa) to have this feature added to Bamboo. Once you do that please post the link here so others can vote on it and add impact.

Cheers,

Branden

comments: author: elac16
body: Hi Branden,

Thanks for the answer. I will try that using REST APIs. As you recommended, I have created a [Jira](https://jira.atlassian.com/browse/BAM-18604) ticket. Expecting this feature soon :)


Tags: bamboo-administration

bamboo-app
Delete a value of a custom field option
Asked by Carlos Ramirez:

### Hi team, {#toc-hId-2112474895}

What happen to the info of the tickets when I delete a value fo a custom field option

Tahnk you


Answers:
author: Dexter de Vera
body: If you delete the selected value from custom field, it will be set to empty/none because the value no longer exist.

comments: author: Carlos Ramirez
body: Thank you [@Dexter de Vera](/t5/user/viewprofilepage/user-id/4657717)

So, What do you suggest for this case. I need no longer the user can select an specific value of the list.

But I can't delete it.

Thank you


Tags: cloud

jira-service-management

jira-service-management-cloud
How do I add a customer to our Jira Service Project?
Asked by Phil Dorcas:

When I add a new customer to our JSM, he gets an email, but the links in the email are not correct. His access is to the wrong JSM project, and he also doesn't have portal access to our knowledge base in Confluence.  

How can I configure the email invitation to add the customer to the correct JSM project and also give him access to our knowledge base in Confluence?


Answers:
author: Kai Becker
body: Hi [@Phil Dorcas](/t5/user/viewprofilepage/user-id/3868704)

thanks for your question.

Could you please specify how you add a new customer?

Did you know, that you could add them directly inside the project? This can be done via the Customer option in the sidebar and hitting "Add Customers"

![Screenshot 2024-02-14 at 23.52.16.png](https://community.atlassian.com/t5/image/serverpage/image-id/306466i3B4AD23C1AC6D028/image-dimensions/317x288?v=v2 "Screenshot 2024-02-14 at 23.52.16.png")

This should take them directly to the right project and grant the relevant Knowledge Base access if setup in the project.

If you add customers from the admin menu, they will be added to the help center and might access a wrong project that is open to any customer.

comments: author: Phil Dorcas
body: I added from the customer option in the sidebar and selected "Add Customers." The email invitation did not bring them to the right project.


Tags: cloud

customer

jira-service-management

jira-service-management-cloud