To add a custom script condition, follow these steps:

  1. Add your Inline Script.

    If the script returns true, or a truthy value, the subsequent tasks are executed. If not, they are skipped.

    You can write the script directly in the Script tab, or you can use the File tab to upload a script.

  2. Enter how many tasks you want to run if the condition is true in How Many Tasks.

  3. Save the task.

As mentioned earlier, the code for all condition tasks runs on the server before any task in the job is executed. This is because you have access to the full Bamboo API, rather than just a subset as on a remote agent. Also, most things that you would want to check can be done when a job is first scheduled rather than during execution.