please follow the below steps of requirements
1. Adding the TagName(exp V6.5.1) to the master branch in the bitbucket
2.checkout the repository in bamboo plan
3.Read the TAG name "V6.5.1" in bamboo plane and assign to some variable
4.every check into the bitbucket we are adding the TagName, we want to use the TagName in the bamboo plan which is added in the bitbucket
5. now am able to read the Branch name using "bamboo.planRepository.<position>.name" variable