youngmon/atlassian-qna huggingface dataset:
How do I get the build number of an in-progress build with Bamboo REST API?
Asked by Andres Delfino:

I want to get the build number of a build that is running on a given plan with the Bamboo REST API.

result/\<plank key\>-latest returns the last finished build result so it cannot be used to get an in-progress build information :/

Does anyone know how to do this **with the REST API**?


Answers:
author: Jimmy Seddon
body: Hi [@Andres Delfino](/t5/user/viewprofilepage/user-id/2469244),

I think what you are asking for looks to be this suggestion:

<https://jira.atlassian.com/browse/BAM-3471>

From the looks of it there isn't anyway to grab the "In Progress" build unless you know what the build number of the in progress build is.

Sorry I can't offer any more help than that.

-James

comments: author: Andres Delfino
body: Hi, James!

Thanks for the information. Just voted for the issue :)

I'm marking as answered as "it's not possible" does count as an answer, heh.


author: amushead
body: Hi, I found a way going through the branch API, example:

Curl GET in API:  
bamboo.url.com/rest/api/latest/plan/MY-PLANKEY/branch/BRANCH-NAME.json

The almost last item of the returned json is something like that:

"latestCurrentlyActive": {  
"lifeCycleState": "InProgress",  
"key": "PLAN-BRANCHKEY-22",  
"number": 22  
},


Tags: rest

rest-api
How to trigger bamoo plan ,when bitbucker delete a branch?
Asked by roamerxv:

When i delete a branch in bitbucket , i wang trigger a bamboo build ? But i don't knonw how tu trigger the bamoo


Answers:
author: Steffen Opel _Utoolity_
body: Triggering a build via arbitrary remote event integration is not natively available. That said, you can achieve this with third party apps and a bit of scripting, for example [ScriptRunner for Bamboo](https://marketplace.atlassian.com/apps/1217785/scriptrunner-for-bamboo-beta):

1. Create a new [Script Event Handler](https://scriptrunner.adaptavist.com/latest/bamboo/event-handlers.html) for the *BranchDeletedEvent*
2. Trigger a build via the [Bamboo REST API](https://docs.atlassian.com/atlassian-bamboo/REST/latest/) (or the Bamboo Java API) from the attached script
   * See [this answer](https://community.atlassian.com/t5/Bamboo-questions/How-to-run-new-build-plan-from-REST-api-call/qaq-p/909711) for more details on the resp. REST API action.
   * See [this example](https://confluence.sreenidhi-gsd.com/display/DEVOPS/Script+Runner+-+Trigger+Bamboo+Build+for+JIRA+Post+Function) for a resp. ScriptRunner script (haven't tested this myself)

comments: author: roamerxv
body: Thank for your reply . I try it .


Tags: jira
'#' is not recognized as an internal or external command
Asked by Calvin Ngu:

Hi,  
I have multiple deployment processes that run a (Shell - inline) script that starts with:

```

# a comment
if [[ ${bamboo_countryFile} =~ ^test ]]; then
.
..
...
and does an rsync at the end...
```

**Sometimes** I get the errors:

```

'#' is not recognized as an internal or external command, operable program or batch file.
${bamboo_countryFile} was unexpected at this time.
```

Or

```
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
```

<br />

The script is set on multiple deployment environments and the errors occur randomly on most of the environments when run concurrently, such as being triggered from a successful build/deployment. However, they are **usually ok with no errors when the environments are run manually individually**.

Thanks.


Answers:
author: Jimmy Seddon
body: Hi Calvin,

Just as a thought do you have multiple agents that are running these deployments and have you looked to see which agent happens to be running the job when it passes vs fails.

I only ask because this is how I found an agent I had forgotten to update with the latest version of a tool we use when jobs were randomly failing and it just happen to be luck of the draw as to which job ran though that agent.

Just something to think about. I hope that helps you.

-James

comments: author: Calvin Ngu
body: Hi James,

Yes, it was agent related. So after I specified a linux agent, it worked.

Thanks,

Calvin


author: Jimmy Seddon
body: Hey Calvin,

I'm glad that fixed things for you!

-James
Inability to install plugin on Bamboo container
Asked by Amari:

While attempting to install aqconnect-1.0.jar on a containerized Bamboo image, the installation hangs with a "Unexpected error occurred" message. After referring to the logs in Bamboo, the trail goes cold because no logs are generated.

Only one log is generated. 1 single log which is an ackwkowlegement that the user clicked the link.

To reproduce this error do the following:

Containerize a Bamboo instance in a cloud provider using Kubernetes

Attempt to install aqconnect-1.0.jar

Watch failure happen.

How do I install the aqconnect-1.0.jar? I've attempted to copy it to the plugin folder but it does not show up in the applications list.

There's no other way to install anapplication? Why is this happening?


Answers:
author: Daniel Santos
body: Hi [@Amari](/t5/user/viewprofilepage/user-id/2923747)

I'm not a Kubernets specialist but I want to share my 2 cents on this one.
> How do I install the aqconnect-1.0.jar? I've attempted to copy it to the plugin folder but it does not show up in the applications list.

Please make sure you installed in **\<Bamboo_Home\>/plugins** directory.

I was able to get it working as expected following this sequence of commands:

1. Create the container:

   ```
   $ docker run -d \
   --name="bamboo-6.8.1" \
   -v <HOST_DOCKER_FOLDER>/bamboo/6.8.1/home:/var/atlassian/application-data/bamboo \
   -p 8085:8085 \
   -p 54663:54663 \
   dchevell/bamboo:6.8.1
   ```

2. Configure it:  
   Access through the UI, add license and follow the wizard until the end
3. Stop the container:

   ```
   docker stop bamboo-6.8.1
   ```

4. Download the plugin:

   ```
   wget https://github.com/accelQ-Inc/accelQ-Connect-Bamboo/releases/download/1.5/aqconnect-1.0.jar
   ```

5. Copy the plugin to the right container folder

   ```
   docker cp aqconnect-1.0.jar bamboo-6.8.1:/var/atlassian/application-data/bamboo/plugins/aqconnect-1.0.jar
   ```

6. Start the container:

   ```
   docker start bamboo-6.8.1
   ```

> There's no other way to install anapplication? Why is this happening?

You can also install through the UI of your Bamboo instance through **Admin \>\> Overview \>\> Manage apps \>\> Upload app.**

I'm afraid there is something wrong with the installation process. Please review where the plugin is installed and what are the container first logs at the moment of Bamboo server initialization. The logs should be at **\<Bamboo_Install\>/logs/catalina.out.**

I hope that helps.


Tags: docker
Can windows agent use a .exe located on a drive different from that of the working drive?
Asked by Landon Cooper:

I am doing some integration with a reporting tool and a windows bamboo agent. The working directory on the windows agent is on the C: drive. The installed software I want to integrate with is located on the D: drive. Is there some way I can point the agents sub directory to a different disk on the computer?


Answers:
author: Landon Cooper
body: So thank you James for the response. The Capability will work and I have also thought I may try to just write a script that will change to the correct disk and execute the CI commands.


author: Jimmy Seddon
body: Hi Landon,

Your question appears different from the details you provided. I'm going to try and answer the question and please let me know if I have mis-understood what you are trying to accomplish.

If you are trying to call/execute a \*.exe file that is installed on an agent machine have you tried adding it as a "Server capabilities" for local agents, or to the "Capabilities" tab on a remote agent?

![AgentCapabilities.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/53856i1BA5F2482D39D5F6/image-dimensions/505x95?v=v2 "AgentCapabilities.JPG")

From there you should be able to add a "Command" task in your Build Plan or Deployment Project that can call that executable with the parameters that you wish to execute.

![CommandTask.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/53857iF367A8ED968D911A/image-dimensions/565x288?v=v2 "CommandTask.JPG")

I hope that helps answer your question!

-James

comments: author: Landon Cooper
body: [@Jimmy Seddon](/t5/user/viewprofilepage/user-id/512822) thanks for the prompt response. This was a different approach than I was thinking. Let me see if I can work this out.


author: Jimmy Seddon
body: Hey Landon,

I'm glad that was able to get things working for you!

-James
pass artifact name to argument for shell script
Asked by Jeremiah Alfrey:

I have a plan that generates a single artifact. It has some \<random name\>.bit

In another plan I import this artifact. I need to pass the name and full path of that artifact to a script. I see that you can include arguments when calling a script but I don't know the variable name for the artifacts. I read up on the bamboo variables and did not see any mention of artifacts.

I could use shell tricks to identify the artifact name and full path but I believe bamboo should have the exact details.


Answers:
author: Daniel Santos
body: Hi [@Jeremiah Alfrey](/t5/user/viewprofilepage/user-id/2953043)

You are correct, there is no variable for that specifically. Even though that is the case, we can easily build paths with the following steps:

1. Set a **Destination path**in your artifact download task (e.g. downloaded_artifacts).
2. All file paths could be built with:

   ```
   ${bamboo.build.working.directory}/downloaded_artifacts/*
   ```

Does that solution work for your case?

Assuming you consider this should be a feature in Bamboo, please feel free to raise it to our development team through <https://jira.atlassian.com/issues>

1. Log in with your Atlassian user
2. Click the **Create** button in the top of the page
3. Select **Bamboo (BAM)** on **Project field**
4. Select **Suggestion** on **Issue Type field**

I hope that helps.

comments: author: Jeremiah Alfrey
body: When I download an artifact from other steps. It seems to come with the complete path where it was created in the previous project. In addition I am using wild card match to retrieve the artifact. This causes me to not know the complete file name.

some dir/some sub dir/output dir/some weird filename.bit

all I know is I got \*.bit


author: Daniel Santos
body: Got it! In this case, if the artifact path or filename does **NOT** have spaces I would use something like:

```
$(find ${bamboo.build.working.directory}/downloaded_artifacts/ -name *\.bit)
```

(i) This line could be used as an argument of your script.

If the artifact path or filename has spaces, I would use this to get them quoted:

```
find ${bamboo.build.working.directory}/downloaded_artifacts/ -name *\.bit > file
$(while read i; do echo \'$i\'; done < file)
```

(i) In this second example, the second line could be the argument of your script.

Let me know if that makes sense.


author: Jeremiah Alfrey
body: That is essentially what I had to do. My paths do not have spaces. I only used it as an example for easy reading.


author: Daniel Santos
body: I'm glad you have this solved.   
In case you want to open the feature request, please let me know if you need any help.


Tags: script
Bamboo Deployment result not in logs
Asked by Chris Bellar:

I'm using Splunk to to ingest Bmaboo logs, but have noticed that deployment results aren't logged. Here is an example of what is logged after the event:

2019-05-06 10:12:10,999 INFO \[9-BuildTailMessageProcessingThread-expensive:pool-16-thread-2377\] \[DeploymentExecutionServiceImpl\] 53477381-125599956-162468176: Finished processing deployment result Deployment of 'DEV-754' on 'DEV'

Is there a way to get Bamboo to log the results of deployments so I can parse it with Splunk?


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

Thanks for sharing the log message which was very helpful in this case.

According to that message your deployment is running on a remote agent and that is the reason you don't see more log details directly in your server logs. All logs would be there if your deployment was running on a local agent.

**Where are my deployment logs?**

You should be able to find your deployment logs downloaded from the remote agent at:

* \<Bamboo_Home\>/xml-data/builds/\<DEPLOYMENT_ID\>-\<ENVIRONMENT_ID\>/download-data/build_logs/

*The file name will be:*

* *\<DEPLOYMENT_ID\>-\<ENVIRONMENT_ID\>-\<RESULT_ID\>.log*

luckily, all the IDs are in the log message you shared as you can see below in bold:
> 2019-05-06 10:12:10,999 INFO \[9-BuildTailMessageProcessingThread-expensive:pool-16-thread-2377\] \[DeploymentExecutionServiceImpl\] **53477381-125599956-162468176**: Finished processing deployment result Deployment of 'DEV-754' on 'DEV'

so this should be the address of your deployment log:

* *\<Bamboo_Home\>/xml-data/builds/**53477381**-**125599956**/download-data/build_logs/**53477381**-**125599956**-**162468176**.log*

Please let me know if you need any clarifications.

comments: author: Chris Bellar
body: Thank you [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125) !


author: Daniel Santos
body: You are welcome! =\]


Tags: developer

log

splunk
Using Docker Runner in Docker-based Bamboo
Asked by Fernando Karnagi:

Dear Folks / Atlassian Support,

I have Bamboo Server 6.9 running as a Docker Container. I can run standard plan with Local Agent.

I have a need to run Docker runner.

Is anyone able to do this? If yes, can share how to do this?


Answers:
author: Daniel Santos
body: Hello [@Fernando Karnagi](/t5/user/viewprofilepage/user-id/2009843)

You can keep Bamboo inside a docker if your agents are not dockerized. Considering your agents are native processes they would be able to spin docker instances as needed. In other words, you cannot use local agents for this purpose, unless your Bamboo server is not dockerized.

You can see more details on this question: [Does bamboo offer docker capabilities if it is itself deployed through docker?](https://community.atlassian.com/t5/Bamboo-questions/Does-bamboo-offer-docker-capabilities-if-it-is-itself-deployed/qaq-p/1029450)

I hope that helps!
Out of space
Asked by Mikkel Thomsen:

When building my artifacts, I tend to compress the files, and today I received the following error in my build:

gzip: stdout: No space left on device

So I checked my overall disk usage, and I use maybe 50/300 GB.

I proceeded with a "df" and the following was returned:

![CKoDLIl](/t5/image/serverpage/image-id/53516i3954CA16BFC3C312/image-size/large?v=v2&px=999 "CKoDLIl")

I must admit, my linux foo is not very strong, but to me, it seems like something is wrong, if a partition is 99% used, and the OS is complaining there is no more space.

So I went to the bamboo admin, and went to check how many builds and deployments were stored.

I decreased the numbers, deleting 6 builds, and 13 deployments.

I went to use df again, but this numbers here didn't change.

I tried google, but the only reasonable suggestion, was to change the partition size.

And this is the point where I'm no longer sure of what I'm doing, or, if this is even the issue.

Do you have any recommendations/tips for me? :)


Answers:
author: Nic Brough -Adaptavist-
body: This is not really an Atlassian problem, just one of housekeeping a build server.

But it is one many of us run into a lot.

I would recommend trying to work out where the problem is - find an answer to "what is eating all my disk space?" The df command is excellent for telling you overall usage, but it has a far more powerful friend called du

Go to the root of the partition (in your case, it looks like a single disk, so "cd /") and as root, run "du --max-depth 1". This will tell you which directories are biggest, so you can descend into each of them and repeat the command.

My usual mistake is to not set up "log rotate" for /opt/atlassian-stuff, but another good one is having a system that errors a lot spitting out way too much data into /var/log (I've got a broken postfix on one of my home machines that's currently clobbering /var/log/mail\*.log for about 2% of the disk every day...)


author: Craig Castle-Mead
body: Hi Mikkel,

One extra piece of information that may help explain your situation - Linux will often keep a % of your partition available for root, this could explain why df is showing 99% used but the application is unable to write to it.

either way, running on 1% available is obviously risky!

Work through the suggestions from [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454) above to find where the space is going to and clean up.

CCM


Tags: bitbucket
Rerun a successful Bamboo build with REST call
Asked by agardner:

Hi,

I would like to be able to rerun an old successful build in a plan using the Bamboo REST API. I was wondering whether anyone has an idea for how to do this?

Thanks


Answers:
author: Gonchik Tsymzhitov
body: Hi!

You can use the execute build method

<https://docs.atlassian.com/atlassian-bamboo/REST/5.5.0/>

<https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/bamboo.py#L349>


Tags: developer
How to create an agent via REST API?
Asked by Sentinel:

Hello,

Is there any possibility to create an agent via Bamboo REST API?

Currently I need to create/remove (bulk) local agents.

Thanks


Answers:
author: Daniel Santos
body: Hi [@Sentinel](/t5/user/viewprofilepage/user-id/3097339)

Let me share what I have on your comments to see if I can help you move forward.
> Is there any possibility to create an agent via Bamboo REST API?

Bamboo doesn't have a REST API for creating an agent but to approve one installed: [/agent/authentication/{agentUuid}.](https://docs.atlassian.com/atlassian-bamboo/REST/6.8.1/#d2e3166)
> Currently I need to create/remove (bulk) local agents.

To bulk install agents you could use a script to spin multiple agent docker containers ([atlassian/bamboo-agent-base - Docker Hub](https://hub.docker.com/r/atlassian/bamboo-agent-base)). Or even a local script to install them as native processes.

Keep in mind that you will have to approve them in **Admin \> Agent \> Agent Authentication** . Another option, in case your Bamboo is not a public instance, is to disable the [Agent authentication](https://confluence.atlassian.com/bamboo/agent-authentication-289277196.html) to let them all connect and then re-enabling the authentication approving them all at once.

I also would like to share the option of using [Elastic Bamboo](https://confluence.atlassian.com/bamboo/about-elastic-bamboo-289277118.html). It would allow your Bamboo instance to automatically add and remove agents on demand by instantiating them an AWS EC2.

comments: author: Sentinel
body: Thanks, [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125)  
Seems this is ok for me, will try it.


author: Daniel Santos
body: Great! You are welcome!


Tags: api
Can a viewer role in Jira see all the tickets that were opened in the project they are in?
Asked by Vera Valshonok:

Hi Community!

Can a viewer role in Jira see all the tickets that were opened in the project they are in? ( not only the once shared with them one by one or the once that have them assigned or opened by them)


Answers:
author: Rudy Holtkamp
body: Hi [@Vera Valshonok](/t5/user/viewprofilepage/user-id/5174542) ,

When you have the browse permission, you can see all issues in a project. Unless a security level is set on an issue. If a user is not in that security level, the user can't see the issue at all.

Which permission he viewer role has is determined by the permission scheme, so plese check that too.

Kind regards,

Rudy

comments: author: Vera Valshonok
body: Thanks!


author: Vera Valshonok
body: In a permission scheme I sont see such a permission that would mention something like - ability to see all the issues in the project.


author: Rudy Holtkamp
body: [@Vera Valshonok](/t5/user/viewprofilepage/user-id/5174542) ,

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

If you go to project settings \> Permissions

You will see the browse projects permission (1) \& and the users/groups/project roles that have this permission.


author: Vera Valshonok
body: Thanks


Tags: cloud

jira-service-management

jira-service-management-cloud
Assist in Teams does not connect properly?
Asked by Kira Linnig:

I've been trying to set up the Assist App in Microsoft Teams for a few days.

I can't get it to work.

Assist has all the permissions needed and is available among the Teams Apps, but when I'm adding it to a team, Teams opens the correct channel but no "welcome" messages are send by Assist.

I'm using the new Teams-Client.

I've already tried the same prcedure with the new Web-Client and the old Dektop-Client, but it's alsways the same outcome.

My Browsers (Chrome, Edge, Firefox) won't let me use the old Web-Client.

Does anybody know what I'm doing wrong or what I'm missing?


Answers:
author: Darlene Jeter
body: Same issue here. By chance did you see this post?

[Solved: Issues with Atlassian Assist Teams App](https://community.atlassian.com/t5/Jira-Service-Management/Issues-with-Atlassian-Assist-Teams-App/qaq-p/2734789)


author: Jean-Christophe GUILLOT
body: Same problem here, do you have a resolution ?


author: Patrick Spitzer
body: Seeing the same issue in our instance as well. Even tried removing it and adding it back in Teams and SMS.


Tags: addon-microsoft-teams

cloud

jira-service-management

jira-service-management-cloud

ms-teams
How to filter for scheduled, but only for next month
Asked by Ardjan Besse:

We are using the scheduled function a lot: when someone should be revoked access rights, when HR notifies us that someone's leaving, etc. Some of these dates are rather far in the future.

We use a filter for the dashboard to show is all upcoming and on-hold tickets. But since this list is rather long, I am trying to get a list of on-hold and scheduled, but only if the scheduled date is less than a month from now.

I am trying with

```
status in ("Escalated / On hold", Scheduled) AND "Planned end[<30d]"
```

but I don't manage to get the syntax right.

Can anyone help me?

*** ** * ** ***

Edit: SOLVED.

When using

```
Status = "Escalated / On hold" OR (Status = Scheduled AND "Planned start[Time stamp]" <= startOfDay(30)) ORDER BY key
```

it works. The part "**\[Time stamp\]**" is not filled by any parameter, and I should have used 'Planned start' anyway :-)


Answers:
author: Jack Brickey
body: Hi [@Ardjan Besse](/t5/user/viewprofilepage/user-id/5498927) , welcome to the community.

Assuming planned end only applies to scheduled status try this.

Status = "escalated / on hold" OR (Status = scheduled and "planned end" \<= startofday(30))

comments: author: Ardjan Besse
body: Thanks, but sorry, it doesn't work.

When I type the filter, the 'planned end' statement autocompletes to "**Planned end\[Time stamp\]**" and I cannot find the correct syntax for this statement in the docs...


author: Costis Papadopoulos
body: Hi it doesn't work for me either, any assistance would be great!


Tags: cloud

jira-service-management

jira-service-management-cloud