Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Can I tell Bamboo to accept a different return code from a command as a pass?

I am trying to run a zip command to package up some artifacts as part of a stage and the tool run from CMD returns 1. Bamboo marks the job as failed because it says it was expecting 0 but valid return codes from the zip tool are 1 for success and negative for failures.

4 answers

1 accepted

1 vote
Answer accepted

I'm not sure you can configure Bamboo that way, but what you COULD do is wrap the invocation of that tool in a script (shell, batch file, etc. depending on your OS) and have the script exit with 0 if the tool exits with 1 (and simply exit with the same exit code as the tool otherwise). Have your build execute that script rather than the tool directly. It's a little bit of work (and I DO think Bamboo should let you define what "Success" and "Failure" exit codes are - I have a couple of problem tools that I've had to do this for myself), but it will get around this problem.

That seems to work, calling 'dir' or 'echo' after the command I want feels a bit silly, but the build passes now.

'exit /b 0' should work too

something like (warning: untested from the top of my head)

REM Do ZIP command
Gretchen Rising Star Sep 16, 2013

Patrick's example above shows the link where you can see a more elaborate example of converting multiple return codes but above it looks like part of the code and so I missed it the first time through. Also see has the myriad of exit codes for Robocopy sorted out into success and failure return codes.

Just started using Bamboo and this is already causing me headaches, so I've raise the following JIRA issue : -

For some reason it wasn't good enough to just "exit /b/ 0". It would still flag the step failed. So I had to actually set the %errorlevel% = 0.

"C:\Program Files\PSTools\psexec.exe" \\servername -s -i -d -accepteula C:\path\to\app.exe
if %errorlevel% GTR 2000 (
ECHO Process started successfully on PID: %errorlevel%
SET %errorlevel% = 0
exit /b %errorlevel%


SET %errorlevel% = 0





To get this solution to work :) 

0 votes
Gretchen Rising Star Sep 16, 2013

I agree with Patrick Aikens' answer and just wanted to add another example that I've used extensively. See the robocopy return code problem here: There is an elaborate example of exit codes (codes 0-7 are good copies but different variations, Codes 8-16 include failures). And how to convert them to 0 for a valid (successful) return code 0.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events