Problem

Depending upon the name of your Git branch, you might want to execute different tasks in your Atlassian Bamboo's plan. This might be the triggering of deployment script after your develop branch has been successfully build.

Solution

Instead of checking the branch name of the last build inside the deployment script, use Bamboo's Conditional Tasks feature.

Enable the checkbox Add condition to task. Then, use you the Condition type Variable to check for the content of the planRepository.${NUMBER}.branchName variable. ${NUMBER} must be replaced with the item number of the connected source repositories. Your first repository is numbered with 1. Set the Condition to matches and specify a regular expression, so that only specific branches are build.

Task configuration

In this screenshot, the regular expression checks if the branch is either develop or starts with feature/JIRAPROJECT.